|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.context.AbstractContext
org.apache.axis2.context.OperationContext
public class OperationContext
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.
Field Summary |
---|
Fields inherited from class org.apache.axis2.context.AbstractContext |
---|
COPY_PROPERTIES, lastTouchedTime, parent, properties |
Constructor Summary | |
---|---|
OperationContext()
Simple constructor (needed for deserialization, shouldn't be used otherwise!) |
|
OperationContext(AxisOperation axisOperation,
ServiceContext serviceContext)
Constructs a new OperationContext. |
Method Summary | |
---|---|
void |
activate(ConfigurationContext cc)
This method checks to see if additional work needs to be done in order to complete the object reconstitution. |
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 . |
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. |
AxisOperation |
getAxisOperation()
|
ConfigurationContext |
getConfigurationContext()
Returns the EngineContext in which the parent ServiceContext lives. |
String |
getLogCorrelationIDString()
Get the ID associated with this object instance. |
MessageContext |
getMessageContext(String messageLabel)
Get the message context identified by a given label. |
HashMap<String,MessageContext> |
getMessageContexts()
|
String |
getOperationName()
Get the name associated with the operation. |
ConfigurationContext |
getRootContext()
|
ServiceContext |
getServiceContext()
Returns the ServiceContext in which this OperationContext lives. |
String |
getServiceGroupName()
Get the name associated with the service group. |
String |
getServiceName()
Get the name associated with the service. |
boolean |
isComplete()
Checks to see if the MEP is complete. |
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. |
void |
isolateMessageContext(MessageContext mc)
Isolate the specified message context object to prepare for serialization. |
void |
readExternal(ObjectInput inObject)
Restore the contents of the object that was previously saved. |
void |
removeMessageContext(String label)
Remove the indicated message context. |
void |
restoreMessageContext(MessageContext msg)
Restore the specified MessageContext object in the table used to hold the message contexts associated with this operation. |
void |
setComplete(boolean complete)
|
void |
setKey(String key)
|
void |
writeExternal(ObjectOutput o)
Save the contents of this object. |
Methods inherited from class org.apache.axis2.context.AbstractContext |
---|
clearPropertyDifferences, flush, getLastTouchedTime, getLocalProperty, getParent, getProperties, getProperty, getPropertyDifferences, getPropertyNames, getPropertyNonReplicable, isAncestor, mergeProperties, removeProperty, removePropertyNonReplicable, setLastTouchedTime, setNonReplicableProperty, setParent, setProperties, setProperty, touch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OperationContext()
public OperationContext(AxisOperation axisOperation, ServiceContext serviceContext)
axisOperation
- the AxisOperation whose running instances' state this
OperationContext represents.serviceContext
- the parent ServiceContext representing any state related to
the set of all operations of the service.Method Detail |
---|
public void addMessageContext(MessageContext msgContext) throws AxisFault
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.
msgContext
-
AxisFault
public void cleanup()
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.
public AxisOperation getAxisOperation()
public ConfigurationContext getConfigurationContext()
public MessageContext getMessageContext(String messageLabel) throws AxisFault
messageLabel
- The label of the message context to retrieve.
This should be one of the MESSAGE_LABEL_xxx
constants
defined in WSDLConstants
.
null
if no
message context was found
AxisFault
- neverpublic void removeMessageContext(String label) throws AxisFault
label
-
AxisFault
public HashMap<String,MessageContext> getMessageContexts()
public ServiceContext getServiceContext()
public boolean isComplete()
public void setComplete(boolean complete)
public void setKey(String key)
public void writeExternal(ObjectOutput o) throws IOException
writeExternal
in interface Externalizable
out
- The stream to write the object contents to
IOException
public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- The stream to read the object contents from
IOException
ClassNotFoundException
public void activate(ConfigurationContext cc)
cc
- The configuration context object representing the active configurationpublic void isolateMessageContext(MessageContext mc)
mc
- The message context objectpublic void restoreMessageContext(MessageContext msg)
msg
- The message context objectpublic String getOperationName()
public String getServiceName()
public String getServiceGroupName()
public boolean isEquivalent(OperationContext ctx)
ctx
- The object to compare with
public String getLogCorrelationIDString()
public ConfigurationContext getRootContext()
getRootContext
in class AbstractContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |