An OperationContext represents a running "instance" of an operation, which is
represented by an AxisOperation object. This concept is needed to allow
messages to be grouped into operations as in WSDL 2.0-speak operations are
essentially arbitrary message exchange patterns. So as messages are being
exchanged the OperationContext remembers the state of where in the message
exchange pattern it is in.
The base implementation of OperationContext
supports MEPs which have one input message and/or one output message. That
is, it supports the all the MEPs that are in the WSDL 2.0 specification. In
order to support another MEP one must extend this class and register its
creation in the OperationContexFactory.
activate(ConfigurationContext cc) This method checks to see if additional work needs to be
done in order to complete the object reconstitution.
Some parts of the object restored from the readExternal()
cannot be completed until we have a configurationContext
from the active engine.
public void
addMessageContext(MessageContext msgContext) When a new message is added to the MEPContext the logic
should be included remove the MEPContext from the table in the
EngineContext.
public void
cleanup() Removes the pointers to this OperationContext in the
ConfigurationContext's OperationContextMap so that this
OperationContext will eventually get garbage collected
along with the MessageContext's it contains.
getLogCorrelationIDString() Get the ID associated with this object instance.
A string that can be output to a log file as an identifierfor this object instance.
getServiceName() Get the name associated with the service.
public boolean
isComplete() Checks to see if the MEP is complete.
public boolean
isEquivalent(OperationContext ctx) Compares key parts of the state from the current instance of
this class with the specified instance to see if they are
equivalent.
readExternal(ObjectInput in) Restore the contents of the object that was previously saved.
NOTE: The field data must read back in the same order and type
as it was written.
public void
restoreMessageContext(MessageContext msg) Restore the specified MessageContext object in the
table used to hold the message contexts associated
with this operation.
Constructs a new OperationContext.
Parameters: axisOperation - the AxisOperation whose running instances' state thisOperationContext represents. Parameters: serviceContext - the parent ServiceContext representing any state related tothe set of all operations of the service.
This method checks to see if additional work needs to be
done in order to complete the object reconstitution.
Some parts of the object restored from the readExternal()
cannot be completed until we have a configurationContext
from the active engine. The configurationContext is used
to help this object to plug back into the engine's
configuration and deployment objects.
Parameters: cc - The configuration context object representing the active configuration
When a new message is added to the MEPContext the logic
should be included remove the MEPContext from the table in the
EngineContext. Example: IN_IN_OUT At the second IN
message the MEPContext should be removed from the AxisOperation.
Parameters: msgContext -
Removes the pointers to this OperationContext in the
ConfigurationContext's OperationContextMap so that this
OperationContext will eventually get garbage collected
along with the MessageContext's it contains. Note that if
the caller wants to make sure its safe to clean up this OperationContext
he should call isComplete() first. However, in cases like IN_OPTIONAL_OUT
and OUT_OPTIONAL_IN, it is possibe this will get called without the MEP
being complete due to the optional nature of the MEP.
Get the ID associated with this object instance.
A string that can be output to a log file as an identifierfor this object instance. It is suitable for matching related logentries.
Compares key parts of the state from the current instance of
this class with the specified instance to see if they are
equivalent.
This differs from the java.lang.Object.equals() method in
that the equals() method generally looks at both the
object identity (location in memory) and the object state
(data).
Parameters: ctx - The object to compare with TRUE if this object is equivalent with the specified objectthat is, key fields matchFALSE, otherwise
Isolate the specified message context object
to prepare for serialization. Instead of
saving the entire message context object,
just setup some metadata about the message
context.
Note: this will remove the specified
message context object from the message context
table.
Parameters: mc - The message context object
Restore the contents of the object that was previously saved.
NOTE: The field data must read back in the same order and type
as it was written. Some data will need to be validated when
resurrected.
Parameters: in - The stream to read the object contents from throws: IOException - throws: ClassNotFoundException -
Restore the specified MessageContext object in the
table used to hold the message contexts associated
with this operation.
Parameters: msg - The message context object
Save the contents of this object.
NOTE: Transient fields and static fields are not saved.
Also, objects that represent "static" data are
not saved, except for enough information to be
able to find matching objects when the message
context is re-constituted.
Parameters: out - The stream to write the object contents to throws: IOException -
Fields inherited from org.apache.axis2.context.AbstractContext