org.mule.execution
Interface MessageProcessPhase<Template extends MessageProcessTemplate>

All Known Implementing Classes:
EndProcessPhase, FlowProcessingPhase, ValidationPhase

public interface MessageProcessPhase<Template extends MessageProcessTemplate>

Defines a phase that process a message using a MessageProcessTemplate The phase will be part of a chain of responsibility were the phase can define the end of the execution of the set of phases by calling: - PhaseResultNotifier.phaseConsumedMessage() which indicates that the phase has consume the message and it should not be longer processed - PhaseResultNotifier.phaseFailure(Exception) which indicates that there was a failure during message processing. Whenever a phase finish execution it must call PhaseResultNotifier.phaseSuccessfully() which will cause the next phase to be executed. Optionally a MessageProcessPhase can implement Comparable to define the order in which it must be positioned in the MessageProcessPhase chain


Method Summary
 void runPhase(Template messageProcessTemplate, MessageProcessContext messageProcessContext, PhaseResultNotifier phaseResultNotifier)
          Process the template through the phase.
 boolean supportsTemplate(MessageProcessTemplate messageProcessTemplate)
          Determines if a certain phase supports a given template.
 

Method Detail

supportsTemplate

boolean supportsTemplate(MessageProcessTemplate messageProcessTemplate)
Determines if a certain phase supports a given template. If phase does not supports the template instance then the phase will be skipped.

Parameters:
messageProcessTemplate - template to be processed
Returns:
true if the phase supports this template, false otherwise

runPhase

void runPhase(Template messageProcessTemplate,
              MessageProcessContext messageProcessContext,
              PhaseResultNotifier phaseResultNotifier)
Process the template through the phase. The phase execution can not throw an exception. In case of exception PhaseResultNotifier.phaseFailure(Exception) must be call.

Parameters:
messageProcessTemplate - template containing message source specific behavior
messageProcessContext - provides context information for executing the message
phaseResultNotifier - notifier that must be advice under certain scenarios


Copyright © 2003-2013 MuleSoft, Inc.. All Rights Reserved.