org.osesb.messagepipeline
Class MessagePipelineContext

java.lang.Object
  extended by org.osesb.processingcontext.ProcessingContext
      extended by org.osesb.messagepipeline.MessagePipelineContext

public class MessagePipelineContext
extends ProcessingContext

MessagePipeline initializes a MessagePipelineContext when pipeline processing starts and remains valid until until pipeline processing completes. The MessagePipelineContext is a variable scratchpad area that is accessible by the MessagePipeline and PipelineStages.

MessagePipelineContext supports:

Since:
Version .9

Field Summary
protected static java.lang.String currentMessageMapKey
          The key used to access the current pipeline EAIMessage.
protected  MessagePipeline parentMessagePipeline
          The MessagePipeline that created this MessagePipelineContext.
protected static java.lang.String resultMessageMapKey
          The key used to access the result for a MessagePipeline run.
 
Fields inherited from class org.osesb.processingcontext.ProcessingContext
contextMap, contextVariableMapKey, thisClassName
 
Constructor Summary
MessagePipelineContext(MessagePipeline parentMessagePipeline)
          Creates a new instance of MessagePipelineContext.
 
Method Summary
 EAIMessage getCurrentMessage()
          Return the current pipeline message.
 MessagePipeline getParentMessagePipeline()
          Returns the MessagePipeline that constructed this MessagePipelineContext.
 EAIMessage getResultMessage()
          Return the result pipeline message.
 void setCurrentMessage(EAIMessage eaiMessage)
          Sets the current pipeline message.
 void setResultMessage(EAIMessage eaiMessage)
          Sets the result pipeline message.
 
Methods inherited from class org.osesb.processingcontext.ProcessingContext
clear, contextVariableExists, getContextVariable, main, setContextVariable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentMessageMapKey

protected static java.lang.String currentMessageMapKey
The key used to access the current pipeline EAIMessage.

When a pipeline starts, the current pipeline message is set by MessagePipeline to the EAIMessage that will be processed by the pipeline.

A PipelineStage runStage() method is always invoked with the current pipeline EAIMessage.

Before returning from runStage(), a PipelineStages can set the current pipeline EAIMessage by invoking the PipelineStage setOutputMessage() method.


resultMessageMapKey

protected static java.lang.String resultMessageMapKey
The key used to access the result for a MessagePipeline run.

After a MessagePipeline runs, there may be a result. It is the responsibility of one of more of the PipelineStages to set the a MessagePipeline result to an instance of EAIMessage.


parentMessagePipeline

protected MessagePipeline parentMessagePipeline
The MessagePipeline that created this MessagePipelineContext.

Constructor Detail

MessagePipelineContext

public MessagePipelineContext(MessagePipeline parentMessagePipeline)
Creates a new instance of MessagePipelineContext.

Method Detail

getCurrentMessage

public EAIMessage getCurrentMessage()
Return the current pipeline message.

Returns:
the current pipeline message.

setCurrentMessage

public void setCurrentMessage(EAIMessage eaiMessage)
Sets the current pipeline message.

Parameters:
eaiMessage - The current pipeline message.

getResultMessage

public EAIMessage getResultMessage()
Return the result pipeline message.

Returns:
the current pipeline message.

setResultMessage

public void setResultMessage(EAIMessage eaiMessage)
Sets the result pipeline message.

Parameters:
eaiMessage - The current pipeline message.

getParentMessagePipeline

public MessagePipeline getParentMessagePipeline()
Returns the MessagePipeline that constructed this MessagePipelineContext.

Returns:
the MessagePipeline that constructed this MessagePipelineContext.