org.osesb.processingcontext
Class ProcessingContext

java.lang.Object
  extended by org.osesb.processingcontext.ProcessingContext
Direct Known Subclasses:
MessagePipelineContext

public class ProcessingContext
extends java.lang.Object

ProcessingContext provides a general context to hold variables, messages, and other artifacts that are needed to accomplish a task or that are the result of some process.

For example, org.osesb.pipeline.Pipeline maintains a ProcessingContext on behalf of PipelineStages.

ProcessingContext supports:

Since:
Version .9

Field Summary
protected  java.util.Map contextMap
          The main ProcessingContext Map.
protected static java.lang.String contextVariableMapKey
          The key used to access the contextVariable Map from contextMap.
protected  java.lang.String thisClassName
          The full name of this class.
 
Constructor Summary
ProcessingContext()
          Creates a new instance of ProcessingContext.
 
Method Summary
 void clear()
          Clears the context.
 boolean contextVariableExists(java.lang.String name)
          Returns true if a contextVariable exists.
 java.lang.Object getContextVariable(java.lang.String name)
          Gets a contextVariable from ProcessingContext, by name.
static void main(java.lang.String[] args)
          main() For testing and sandboxing.
 void setContextVariable(java.lang.String name, java.lang.Object value)
          Sets a named, contextVariable in ProcessingContext.
 java.lang.String toString()
          Returns the String representation of this ProcessingContext as XML text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contextMap

protected java.util.Map contextMap
The main ProcessingContext Map.


contextVariableMapKey

protected static java.lang.String contextVariableMapKey
The key used to access the contextVariable Map from contextMap. Context Variables is a Map of named objects that are accessed using the getContextVariable() and setContextVariable() methods. Context variables are Objects whose meaning and structure are determined by the Classes that set and get the context variables.


thisClassName

protected java.lang.String thisClassName
The full name of this class.

Constructor Detail

ProcessingContext

public ProcessingContext()
Creates a new instance of ProcessingContext.

Method Detail

contextVariableExists

public boolean contextVariableExists(java.lang.String name)
Returns true if a contextVariable exists.

Parameters:
name - The name of the contextVariable to test for.
Returns:
true if a contextVariable exists, false if it does not.

getContextVariable

public java.lang.Object getContextVariable(java.lang.String name)
Gets a contextVariable from ProcessingContext, by name.

Parameters:
name - The name of the contextVariable to get.
Returns:
the contextVariable as an Object.

setContextVariable

public void setContextVariable(java.lang.String name,
                               java.lang.Object value)
Sets a named, contextVariable in ProcessingContext.

Parameters:
name - The name of the contextVariable to set.
value - The value for the contextVariable.

clear

public void clear()
Clears the context.


toString

public java.lang.String toString()
Returns the String representation of this ProcessingContext as XML text.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this ProcessingContext as XML text.

main

public static void main(java.lang.String[] args)
main() For testing and sandboxing.

Parameters:
args - commandline arguments