| Method from org.apache.axis2.context.MessageContext Detail: |
public void activate(ConfigurationContext cc) {
// see if there's any work to do
if (!needsToBeReconciled) {
// return quick
return;
}
// use the supplied configuration context
setConfigurationContext(cc);
// get the axis configuration
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
// We previously saved metaAxisService; restore it
if (metaAxisService != null) {
this.setAxisService(ActivateUtils.findService(axisConfig,
metaAxisService.getClassName(),
metaAxisService.getQNameAsString()));
}
// We previously saved metaAxisServiceGroup; restore it
if (metaAxisServiceGroup != null) {
this.setAxisServiceGroup(
ActivateUtils.findServiceGroup(axisConfig,
metaAxisServiceGroup.getClassName(),
metaAxisServiceGroup.getQNameAsString()));
}
// We previously saved metaAxisOperation; restore it
if (metaAxisOperation != null) {
AxisService serv = axisService;
if (serv != null) {
// TODO: check for the empty name
this.setAxisOperation(ActivateUtils.findOperation(serv,
metaAxisOperation.getClassName(),
metaAxisOperation.getQName()));
} else {
this.setAxisOperation(ActivateUtils.findOperation(axisConfig,
metaAxisOperation.getClassName(),
metaAxisOperation.getQName()));
}
}
// We previously saved metaAxisMessage; restore it
if (metaAxisMessage != null) {
AxisOperation op = axisOperation;
if (op != null) {
// TODO: check for the empty name
this.setAxisMessage(ActivateUtils.findMessage(op,
metaAxisMessage.getQNameAsString(),
metaAxisMessage.getExtraName()));
}
}
//---------------------------------------------------------------------
// operation context
//---------------------------------------------------------------------
// this will do a full hierarchy, so do it first
// then we can re-use its objects
if (operationContext != null) {
operationContext.activate(cc);
// this will be set as the parent of the message context
// after the other context objects have been activated
}
//---------------------------------------------------------------------
// service context
//---------------------------------------------------------------------
if (serviceContext == null) {
// get the parent serviceContext of the operationContext
if (operationContext != null) {
serviceContext = operationContext.getServiceContext();
}
}
// if we have a service context, make sure it is usable
if (serviceContext != null) {
// for some reason, the service context might be set differently from
// the operation context parent
serviceContext.activate(cc);
}
//---------------------------------------------------------------------
// service group context
//---------------------------------------------------------------------
if (serviceGroupContext == null) {
// get the parent serviceGroupContext of the serviceContext
if (serviceContext != null) {
serviceGroupContext = (ServiceGroupContext) serviceContext.getParent();
}
}
// if we have a service group context, make sure it is usable
if (serviceGroupContext != null) {
// for some reason, the service group context might be set differently from
// the service context parent
serviceGroupContext.activate(cc);
}
//---------------------------------------------------------------------
// other context-related reconciliation
//---------------------------------------------------------------------
this.setParent(operationContext);
//---------------------------------------------------------------------
// options
//---------------------------------------------------------------------
if (options != null) {
options.activate(cc);
}
String tmpID = getMessageID();
String logCorrelationIDString = getLogIDString();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":activate(): message ID [" + tmpID + "] for " +
logCorrelationIDString);
}
//---------------------------------------------------------------------
// transports
//---------------------------------------------------------------------
// We previously saved metaTransportIn; restore it
if (metaTransportIn != null) {
QName qin = metaTransportIn.getQName();
TransportInDescription tmpIn = null;
try {
tmpIn = axisConfig.getTransportIn(qin.getLocalPart());
}
catch (Exception exin) {
// if a fault is thrown, log it and continue
log.trace(logCorrelationIDString +
"activate(): exception caught when getting the TransportInDescription [" +
qin.toString() + "] from the AxisConfiguration [" +
exin.getClass().getName() + " : " + exin.getMessage() + "]");
}
if (tmpIn != null) {
transportIn = tmpIn;
} else {
transportIn = null;
}
} else {
transportIn = null;
}
// We previously saved metaTransportOut; restore it
if (metaTransportOut != null) {
// TODO : Check if this should really be a QName?
QName qout = metaTransportOut.getQName();
TransportOutDescription tmpOut = null;
try {
tmpOut = axisConfig.getTransportOut(qout.getLocalPart());
}
catch (Exception exout) {
// if a fault is thrown, log it and continue
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
"activate(): exception caught when getting the TransportOutDescription [" +
qout.toString() + "] from the AxisConfiguration [" +
exout.getClass().getName() + " : " + exout.getMessage() + "]");
}
}
if (tmpOut != null) {
transportOut = tmpOut;
} else {
transportOut = null;
}
} else {
transportOut = null;
}
//-------------------------------------------------------
// reconcile the execution chain
//-------------------------------------------------------
if (metaExecutionChain != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(
logCorrelationIDString + ":activate(): reconciling the execution chain...");
}
currentHandlerIndex = metaHandlerIndex;
currentPhaseIndex = metaPhaseIndex;
executionChain = restoreHandlerList(metaExecutionChain);
try {
deserializeSelfManagedData();
}
catch (Exception ex) {
// log the exception
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activate(): *** WARNING *** deserializing the self managed data encountered Exception [" +
ex.getClass().getName() + " : " + ex.getMessage() + "]", ex);
}
}
}
//-------------------------------------------------------
// reconcile the lists for the executed phases
//-------------------------------------------------------
if (metaExecuted != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activate(): reconciling the executed chain...");
}
if (!(executedPhasesReset)) {
executedPhases =
restoreExecutedList(executedPhases, metaExecuted);
}
}
if (executedPhases == null) {
executedPhases = new LinkedList< Handler >();
}
//-------------------------------------------------------
// finish up remaining links
//-------------------------------------------------------
if (operationContext != null) {
operationContext.restoreMessageContext(this);
}
//-------------------------------------------------------
// done, reset the flag
//-------------------------------------------------------
needsToBeReconciled = false;
}
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. |
public void activateWithOperationContext(OperationContext operationCtx) {
// see if there's any work to do
if (!(needsToBeReconciled)) {
// return quick
return;
}
String logCorrelationIDString = getLogIDString();
// trace point
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":activateWithOperationContext(): BEGIN");
}
if (operationCtx == null) {
// won't be able to finish
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activateWithOperationContext(): *** WARNING *** No active OperationContext object is available.");
}
return;
}
//---------------------------------------------------------------------
// locate the objects in the object graph
//---------------------------------------------------------------------
ConfigurationContext configCtx = operationCtx.getConfigurationContext();
if (configCtx == null) {
// won't be able to finish
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activateWithOperationContext(): *** WARNING *** No active ConfigurationContext object is available.");
}
return;
}
AxisConfiguration axisCfg = configCtx.getAxisConfiguration();
AxisOperation axisOp = operationCtx.getAxisOperation();
ServiceContext serviceCtx = operationCtx.getServiceContext();
ServiceGroupContext serviceGroupCtx = null;
AxisService axisSrv = null;
AxisServiceGroup axisSG = null;
if (serviceCtx != null) {
serviceGroupCtx = serviceCtx.getServiceGroupContext();
axisSrv = serviceCtx.getAxisService();
}
if (serviceGroupCtx != null) {
axisSG = serviceGroupCtx.getDescription();
}
//---------------------------------------------------------------------
// link to the objects in the object graph
//---------------------------------------------------------------------
setConfigurationContext(configCtx);
setAxisOperation(axisOp);
setAxisService(axisSrv);
setAxisServiceGroup(axisSG);
setServiceGroupContext(serviceGroupCtx);
setServiceContext(serviceCtx);
setOperationContext(operationCtx);
//---------------------------------------------------------------------
// reconcile the remaining objects
//---------------------------------------------------------------------
// We previously saved metaAxisMessage; restore it
if (metaAxisMessage != null) {
if (axisOp != null) {
// TODO: check for the empty name
this.setAxisMessage(ActivateUtils.findMessage(axisOp,
metaAxisMessage.getQNameAsString(),
metaAxisMessage.getExtraName()));
}
}
//---------------------------------------------------------------------
// options
//---------------------------------------------------------------------
if (options != null) {
options.activate(configCtx);
}
String tmpID = getMessageID();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":activateWithOperationContext(): message ID [" +
tmpID + "]");
}
//---------------------------------------------------------------------
// transports
//---------------------------------------------------------------------
// We previously saved metaTransportIn; restore it
if (metaTransportIn != null) {
QName qin = metaTransportIn.getQName();
TransportInDescription tmpIn = null;
try {
tmpIn = axisCfg.getTransportIn(qin.getLocalPart());
}
catch (Exception exin) {
// if a fault is thrown, log it and continue
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
"activateWithOperationContext(): exception caught when getting the TransportInDescription [" +
qin.toString() + "] from the AxisConfiguration [" +
exin.getClass().getName() + " : " + exin.getMessage() + "]");
}
}
if (tmpIn != null) {
transportIn = tmpIn;
} else {
transportIn = null;
}
} else {
transportIn = null;
}
// We previously saved metaTransportOut; restore it
if (metaTransportOut != null) {
QName qout = metaTransportOut.getQName();
TransportOutDescription tmpOut = null;
try {
tmpOut = axisCfg.getTransportOut(qout.getLocalPart());
}
catch (Exception exout) {
// if a fault is thrown, log it and continue
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
"activateWithOperationContext(): exception caught when getting the TransportOutDescription [" +
qout.toString() + "] from the AxisConfiguration [" +
exout.getClass().getName() + " : " + exout.getMessage() + "]");
}
}
if (tmpOut != null) {
transportOut = tmpOut;
} else {
transportOut = null;
}
} else {
transportOut = null;
}
//-------------------------------------------------------
// reconcile the execution chain
//-------------------------------------------------------
if (metaExecutionChain != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activateWithOperationContext(): reconciling the execution chain...");
}
currentHandlerIndex = metaHandlerIndex;
currentPhaseIndex = metaPhaseIndex;
executionChain = restoreHandlerList(metaExecutionChain);
try {
deserializeSelfManagedData();
}
catch (Exception ex) {
// log the exception
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activateWithOperationContext(): *** WARNING *** deserializing the self managed data encountered Exception [" +
ex.getClass().getName() + " : " + ex.getMessage() + "]", ex);
}
}
}
//-------------------------------------------------------
// reconcile the lists for the executed phases
//-------------------------------------------------------
if (metaExecuted != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":activateWithOperationContext(): reconciling the executed chain...");
}
if (!(executedPhasesReset)) {
executedPhases =
restoreExecutedList(executedPhases, metaExecuted);
}
}
if (executedPhases == null) {
executedPhases = new LinkedList< Handler >();
}
//-------------------------------------------------------
// done, reset the flag
//-------------------------------------------------------
needsToBeReconciled = false;
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":activateWithOperationContext(): END");
}
}
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 an object that gives us
a view of the active object graph from the active engine.
NOTE: when activating an object, you only need to call
one of the activate methods (activate() or activateWithOperationContext())
but not both. |
public String addAttachment(DataHandler dataHandler) {
String contentID = UUIDGenerator.getUUID();
addAttachment(contentID, dataHandler);
return contentID;
}
Adds an attachment to the attachment Map of this message context. This
attachment gets serialised as a MIME attachment when sending the message
if SOAP with Attachments is enabled. Content ID of the MIME part will be
auto generated by Axis2. |
public void addAttachment(String contentID,
DataHandler dataHandler) {
if (attachments == null) {
attachments = new Attachments();
}
attachments.addDataHandler(contentID, dataHandler);
}
Adds an attachment to the attachment Map of this message context. This
attachment gets serialised as a MIME attachment when sending the message
if SOAP with Attachments is enabled. |
public void addExecutedPhase(Handler phase) {
if (executedPhases == null) {
executedPhases = new LinkedList< Handler >();
}
executedPhases.addFirst(phase);
}
Add a Phase to the collection of executed phases for the path.
Phases will be inserted in a LIFO data structure. |
public void addRelatesTo(RelatesTo reference) {
options.addRelatesTo(reference);
}
|
public boolean containsSelfManagedDataKey(Class clazz,
Object key) {
if (selfManagedDataMap == null) {
return false;
}
return selfManagedDataMap.containsKey(generateSelfManagedDataKey(clazz, key));
}
Check to see if the key for the self managed data is available |
public MessageContext extractCopyMessageContext() {
MessageContext copy = new MessageContext();
String logCorrelationIDString = getLogIDString();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":extractCopyMessageContext(): based on " +
logCorrelationIDString + " into copy " + copy.getLogIDString());
}
//---------------------------------------------------------
// various simple fields
//---------------------------------------------------------
copy.setFLOW(FLOW);
copy.setProcessingFault(processingFault);
copy.setPaused(paused);
copy.setOutputWritten(outputWritten);
copy.setNewThreadRequired(newThreadRequired);
copy.setDoingREST(doingREST);
copy.setDoingMTOM(doingMTOM);
copy.setDoingSwA(doingSwA);
copy.setResponseWritten(responseWritten);
copy.setServerSide(serverSide);
copy.setLastTouchedTime(getLastTouchedTime());
//---------------------------------------------------------
// message
//---------------------------------------------------------
try {
copy.setEnvelope(envelope);
}
catch (Exception ex) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":extractCopyMessageContext(): Exception caught when setting the copy with the envelope",
ex);
}
}
copy.setAttachmentMap(attachments);
copy.setIsSOAP11Explicit(isSOAP11);
//---------------------------------------------------------
// ArrayList executionChain
// handler and phase related data
//---------------------------------------------------------
copy.setExecutionChain(executionChain);
// the setting of the execution chain is actually a reset
// so copy the indices after putting in the execution chain
copy.setCurrentHandlerIndex(currentHandlerIndex);
copy.setCurrentPhaseIndex(currentPhaseIndex);
//---------------------------------------------------------
// LinkedList executedPhases
//---------------------------------------------------------
copy.setExecutedPhasesExplicit(executedPhases);
//---------------------------------------------------------
// options
//---------------------------------------------------------
copy.setOptionsExplicit(options);
//---------------------------------------------------------
// axis operation
//---------------------------------------------------------
copy.setAxisOperation(null);
//---------------------------------------------------------
// operation context
//---------------------------------------------------------
copy.setOperationContext(null);
//---------------------------------------------------------
// axis service
//---------------------------------------------------------
copy.setAxisService(null);
//-------------------------
// serviceContextID string
//-------------------------
copy.setServiceContextID(serviceContextID);
//-------------------------
// serviceContext
//-------------------------
copy.setServiceContext(null);
//---------------------------------------------------------
// serviceGroup
//---------------------------------------------------------
copy.setServiceGroupContext(null);
//-----------------------------
// serviceGroupContextId string
//-----------------------------
copy.setServiceGroupContextId(serviceGroupContextId);
//---------------------------------------------------------
// axis message
//---------------------------------------------------------
copy.setAxisMessage(axisMessage);
//---------------------------------------------------------
// configuration context
//---------------------------------------------------------
copy.setConfigurationContext(configurationContext);
//---------------------------------------------------------
// session context
//---------------------------------------------------------
copy.setSessionContext(sessionContext);
//---------------------------------------------------------
// transport
//---------------------------------------------------------
//------------------------------
// incomingTransportName string
//------------------------------
copy.setIncomingTransportName(incomingTransportName);
copy.setTransportIn(transportIn);
copy.setTransportOut(transportOut);
//---------------------------------------------------------
// properties
//---------------------------------------------------------
// Only set the local properties (i.e. don't use getProperties())
copy.setProperties(properties);
//---------------------------------------------------------
// special data
//---------------------------------------------------------
copy.setSelfManagedDataMapExplicit(selfManagedDataMap);
//---------------------------------------------------------
// done
//---------------------------------------------------------
return copy;
}
Return a Read-Only copy of this message context
that has been extracted from the object
hierachy. In other words, the message context
copy does not have links to the object graph.
NOTE: The copy shares certain objects with the original.
The intent is to use the copy to read values but not
modify them, especially since the copy is not part
of the normal *Context and Axis* object graph. |
public DataHandler getAttachment(String contentID) {
if (attachments == null) {
attachments = new Attachments();
}
return attachments.getDataHandler(contentID);
}
Access the DataHandler of the attachment contained in the map corresponding to the given
content ID. Returns "NULL" if a attachment cannot be found by the given content ID. |
public Attachments getAttachmentMap() {
if (attachments == null) {
attachments = new Attachments();
}
return attachments;
}
You can directly access the attachment map of the message context from
here. Returned attachment map can be empty. |
public AxisMessage getAxisMessage() {
if (reconcileAxisMessage) {
if (LoggingControl.debugLoggingAllowed && log.isWarnEnabled()) {
log.warn(this.getLogIDString() +
":getAxisMessage(): ****WARNING**** MessageContext.activate(configurationContext) needs to be invoked.");
}
}
return axisMessage;
}
|
public AxisOperation getAxisOperation() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getAxisOperation");
}
return axisOperation;
}
|
public AxisService getAxisService() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getAxisService");
}
return axisService;
}
|
public AxisServiceGroup getAxisServiceGroup() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getAxisServiceGroup");
}
return axisServiceGroup;
}
|
public ConfigurationContext getConfigurationContext() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getConfigurationContext");
}
return configurationContext;
}
|
public int getCurrentHandlerIndex() {
return currentHandlerIndex;
}
|
public static MessageContext getCurrentMessageContext() {
return (MessageContext) currentMessageContext.get();
}
|
public int getCurrentPhaseIndex() {
return currentPhaseIndex;
}
|
public Policy getEffectivePolicy() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getEffectivePolicy");
}
AxisBindingMessage bindingMessage =
(AxisBindingMessage) getProperty(Constants.AXIS_BINDING_MESSAGE);
// If AxisBindingMessage is not set, try to find the binding message from the AxisService
if (bindingMessage == null) {
bindingMessage = findBindingMessage();
}
if (bindingMessage != null) {
return bindingMessage.getEffectivePolicy();
// If we can't find the AxisBindingMessage, then try the AxisMessage
} else if (axisMessage != null) {
return axisMessage.getEffectivePolicy();
} else {
return null;
}
}
|
public SOAPEnvelope getEnvelope() {
return envelope;
}
|
public Iterator getExecutedPhases() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getExecutedPhases");
}
if (executedPhases == null) {
executedPhases = new LinkedList< Handler >();
}
return executedPhases.iterator();
}
Get an iterator over the executed phase list. |
public ArrayList getExecutionChain() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getExecutionChain");
}
return executionChain;
}
|
public int getFLOW() {
return FLOW;
}
|
public Exception getFailureReason() {
return failureReason;
}
Obtain the Exception which caused the processing chain to halt. |
public EndpointReference getFaultTo() {
return options.getFaultTo();
}
|
public EndpointReference getFrom() {
return options.getFrom();
}
|
public long getInboundContentLength() throws IOException {
// If there is an attachment map, the Attachments keep track
// of the inbound content length.
if (attachments != null) {
// return attachments.getContentLength();
}
// Otherwise the length is accumulated by the DetachableInputStream.
DetachableInputStream dis =
(DetachableInputStream) getProperty(Constants.DETACHABLE_INPUT_STREAM);
if (dis != null) {
return dis.length();
}
return 0;
}
|
public String getIncomingTransportName() {
return incomingTransportName;
}
|
public Object getLocalProperty(String name) {
return getLocalProperty(name, true);
}
Retrieves a property value. The order of search is as follows: search in
my own map and then look at my options. Does not search up the hierarchy. |
public Object getLocalProperty(String name,
boolean searchOptions) {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getProperty");
}
// search in my own options
Object obj = super.getLocalProperty(name);
if (obj != null) {
return obj;
}
if (searchOptions) {
obj = options.getProperty(name);
if (obj != null) {
return obj;
}
}
// tough
return null;
}
|
public String getLogCorrelationID() {
if (logCorrelationID == null) {
logCorrelationID = UUIDGenerator.getUUID();
}
return logCorrelationID;
}
Get a "raw" version of the logCorrelationID. The logCorrelationID
is guaranteed to be unique and may be persisted along with the rest
of the message context. |
public String getLogIDString() {
if (logCorrelationIDString == null) {
logCorrelationIDString = "[MessageContext: logID=" + getLogCorrelationID() + "]";
}
return logCorrelationIDString;
}
Get a formatted version of the logCorrelationID. |
public String getMessageID() {
return options.getMessageId();
}
|
public Parameter getModuleParameter(String key,
String moduleName,
HandlerDescription handler) {
Parameter param;
ModuleConfiguration moduleConfig;
AxisOperation opDesc = getAxisOperation();
if (opDesc != null) {
moduleConfig = opDesc.getModuleConfig(moduleName);
if (moduleConfig != null) {
param = moduleConfig.getParameter(key);
if (param != null) {
return param;
} else {
param = opDesc.getParameter(key);
if (param != null) {
return param;
}
}
}
}
AxisService axisService = getAxisService();
if (axisService != null) {
moduleConfig = axisService.getModuleConfig(moduleName);
if (moduleConfig != null) {
param = moduleConfig.getParameter(key);
if (param != null) {
return param;
} else {
param = axisService.getParameter(key);
if (param != null) {
return param;
}
}
}
}
AxisServiceGroup axisServiceDesc = getAxisServiceGroup();
if (axisServiceDesc != null) {
moduleConfig = axisServiceDesc.getModuleConfig(moduleName);
if (moduleConfig != null) {
param = moduleConfig.getParameter(key);
if (param != null) {
return param;
} else {
param = axisServiceDesc.getParameter(key);
if (param != null) {
return param;
}
}
}
}
AxisConfiguration baseConfig = configurationContext.getAxisConfiguration();
moduleConfig = baseConfig.getModuleConfig(moduleName);
if (moduleConfig != null) {
param = moduleConfig.getParameter(key);
if (param != null) {
return param;
} else {
param = baseConfig.getParameter(key);
if (param != null) {
return param;
}
}
}
AxisModule module = baseConfig.getModule(moduleName);
if (module != null) {
param = module.getParameter(key);
if (param != null) {
return param;
}
}
param = handler.getParameter(key);
return param;
}
Retrieves both module specific configuration parameters as well as other
parameters. The order of search is as follows:
- Search in module configurations inside corresponding operation
description if its there
- Search in corresponding operation if its there
- Search in module configurations inside corresponding service
description if its there
- Next search in Corresponding Service description if its there
- Next search in module configurations inside axisConfiguration
- Search in AxisConfiguration for parameters
- Next get the corresponding module and search for the parameters
- Search in HandlerDescription for the parameter
and the way of specifying module configuration is as follows
N/A |
public OperationContext getOperationContext() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getOperationContext");
}
return operationContext;
}
|
public Options getOptions() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getOptions");
}
return options;
}
|
public Parameter getParameter(String key) {
if( axisMessage != null ) {
return axisMessage.getParameter(key);
}
if (axisOperation != null) {
return axisOperation.getParameter(key);
}
if (axisService != null) {
return axisService.getParameter(key);
}
if (axisServiceGroup != null) {
return axisServiceGroup.getParameter(key);
}
if (configurationContext != null) {
AxisConfiguration baseConfig = configurationContext
.getAxisConfiguration();
return baseConfig.getParameter(key);
}
return null;
}
Retrieves configuration descriptor parameters at any level. The order of
search is as follows:
- Search in message description if it exists
- If parameter is not found or if axisMessage is null, search in
AxisOperation
- If parameter is not found or if operationContext is null, search in
AxisService
- If parameter is not found or if axisService is null, search in
AxisConfiguration
|
public Map getProperties() {
final Map< String, Object > resultMap = new HashMap< String, Object >();
// My own context hierarchy may not all be present. So look for whatever
// nearest level is present and add the properties
// We have to access the contexts in reverse order, in order to allow
// a nearer context to overwrite values from a more distant context
if (configurationContext != null) {
resultMap.putAll(configurationContext.getProperties());
}
if (serviceGroupContext != null) {
resultMap.putAll(serviceGroupContext.getProperties());
}
if (serviceContext != null) {
resultMap.putAll(serviceContext.getProperties());
}
if (operationContext != null) {
resultMap.putAll(operationContext.getProperties());
}
// and now add options
resultMap.putAll(options.getProperties());
return Collections.unmodifiableMap(resultMap);
}
Retrieves all property values. The order of search is as follows: search in
my own options and then look in my context hierarchy. Since its possible
that the entire hierarchy is not present, it will start at whatever level
has been set and start there.
The returned map is unmodifiable, so any changes to the properties have
to be done by calling #setProperty(String,Object) . In addition,
any changes to the properties are not reflected on this map. |
public Object getProperty(String name) {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getProperty");
}
// search in my own options
Object obj = super.getProperty(name);
if (obj != null) {
return obj;
}
obj = options.getProperty(name);
if (obj != null) {
return obj;
}
// My own context hierarchy may not all be present. So look for whatever
// nearest level is present and ask that to find the property.
//
// If the context is already an ancestor, it was checked during
// the super.getProperty call. In such cases, the second check
// is not performed.
if (operationContext != null) {
if (!isAncestor(operationContext)) {
obj = operationContext.getProperty(name);
}
} else if (serviceContext != null) {
if (!isAncestor(serviceContext)) {
obj = serviceContext.getProperty(name);
}
} else if (serviceGroupContext != null) {
if (!isAncestor(serviceGroupContext)) {
obj = serviceGroupContext.getProperty(name);
}
} else if (configurationContext != null) {
if (!isAncestor(configurationContext)) {
obj = configurationContext.getProperty(name);
}
}
return obj;
}
Retrieves a property value. The order of search is as follows: search in
my own map and then look in my context hierarchy, and then in options.
Since its possible
that the entire hierarchy is not present, I will start at whatever level
has been set. |
public RelatesTo getRelatesTo() {
return options.getRelatesTo();
}
|
public RelatesTo getRelatesTo(String type) {
return options.getRelatesTo(type);
}
Get any RelatesTos of a particular type associated with this MessageContext
TODO: Shouldn't this return a List? |
public RelatesTo[] getRelationships() {
return options.getRelationships();
}
|
public EndpointReference getReplyTo() {
return options.getReplyTo();
}
|
public ConfigurationContext getRootContext() {
return configurationContext;
}
|
public Object getSelfManagedData(Class clazz,
Object key) {
if (selfManagedDataMap != null) {
return selfManagedDataMap.get(generateSelfManagedDataKey(clazz, key));
}
return null;
}
Retrieve a value of self managed data previously saved with the specified key. |
public ServiceContext getServiceContext() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getServiceContext");
}
return serviceContext;
}
|
public String getServiceContextID() {
return serviceContextID;
}
|
public ServiceGroupContext getServiceGroupContext() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getServiceGroupContext");
}
return serviceGroupContext;
}
|
public String getServiceGroupContextId() {
return serviceGroupContextId;
}
|
public SessionContext getSessionContext() {
return sessionContext;
}
|
public String getSoapAction() {
return options.getAction();
}
|
public EndpointReference getTo() {
return options.getTo();
}
|
public TransportInDescription getTransportIn() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getTransportIn");
}
return transportIn;
}
|
public TransportOutDescription getTransportOut() {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("getTransportOut");
}
return transportOut;
}
|
public String getWSAAction() {
return options.getAction();
}
|
public boolean isDoingMTOM() {
return doingMTOM;
}
|
public boolean isDoingREST() {
return doingREST;
}
|
public boolean isDoingSwA() {
return doingSwA;
}
|
public boolean isEngaged(String moduleName) {
if (LoggingControl.debugLoggingAllowed) {
checkActivateWarning("isEngaged");
}
boolean enegage;
if (configurationContext != null) {
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
AxisModule module = axisConfig.getModule(moduleName);
if (module == null) {
return false;
}
enegage = axisConfig.isEngaged(module);
if (enegage) {
return true;
}
if (axisServiceGroup != null) {
enegage = axisServiceGroup.isEngaged(module);
if (enegage) {
return true;
}
}
if (axisService != null) {
enegage = axisService.isEngaged(module);
if (enegage) {
return true;
}
}
if (axisOperation != null) {
enegage = axisOperation.isEngaged(module);
if (enegage) {
return true;
}
}
}
return false;
}
|
public boolean isFault() {
try {
return getEnvelope().hasFault();
} catch (Exception e) {
// TODO: What should we be doing here? No envelope certainly seems bad....
return false;
}
}
|
public boolean isHeaderPresent() {
// If there's no envelope there can't be a header.
if (this.envelope == null) {
return false;
}
return (this.envelope.getHeader() != null);
} Deprecated! The - bonus you used to get from this is now built in to SOAPEnvelope.getHeader()
Gets the first child of the envelope, check if it is a soap:Body, which means there is no header.
We do this basically to make sure we don't parse and build the om tree of the whole envelope
looking for the soap header. If this method returns true, there still is no guarantee that there is
a soap:Header present, use getHeader() and also check for null on getHeader() to be absolutely sure. |
public boolean isNewThreadRequired() {
return newThreadRequired;
}
|
public boolean isOutputWritten() {
return outputWritten;
}
|
public boolean isPaused() {
return paused;
}
|
public boolean isProcessingFault() {
return processingFault;
}
|
public boolean isPropertyTrue(String name) {
return isPropertyTrue(name, false);
}
Check if a given property is true. Will return false if the property
does not exist or is not an explicit "true" value. |
public boolean isPropertyTrue(String name,
boolean defaultVal) {
return JavaUtils.isTrueExplicitly(getProperty(name), defaultVal);
}
Check if a given property is true. Will return the passed default if the property
does not exist. |
public boolean isResponseWritten() {
return responseWritten;
}
|
public boolean isSOAP11() {
return isSOAP11;
}
|
public boolean isServerSide() {
return serverSide;
}
|
public void pause() {
paused = true;
}
Pause the execution of the current handler chain |
public void readExternal(ObjectInput inObject) throws ClassNotFoundException, IOException {
SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
// set the flag to indicate that the message context is being
// reconstituted and will need to have certain object references
// to be reconciled with the current engine setup
needsToBeReconciled = true;
// trace point
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(myClassName + ":readExternal(): BEGIN bytes available in stream [" +
in.available() + "] ");
}
//---------------------------------------------------------
// object level identifiers
//---------------------------------------------------------
// serialization version ID
long suid = in.readLong();
// revision ID
int revID = in.readInt();
// make sure the object data is in a version we can handle
if (suid != serialVersionUID) {
throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
}
// make sure the object data is in a revision level we can handle
if (revID != REVISION_2) {
throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
}
//---------------------------------------------------------
// various simple fields
//---------------------------------------------------------
// the type of execution flow for the message context
FLOW = in.readInt();
// various flags
processingFault = in.readBoolean();
paused = in.readBoolean();
outputWritten = in.readBoolean();
newThreadRequired = in.readBoolean();
isSOAP11 = in.readBoolean();
doingREST = in.readBoolean();
doingMTOM = in.readBoolean();
doingSwA = in.readBoolean();
responseWritten = in.readBoolean();
serverSide = in.readBoolean();
long time = in.readLong();
setLastTouchedTime(time);
logCorrelationID = (String) in.readObject();
// trace point
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
logCorrelationIDString = "[MessageContext: logID=" + getLogCorrelationID() + "]";
log.trace(myClassName + ":readExternal(): reading the input stream for " +
getLogIDString());
}
//---------------------------------------------------------
// Message
// Read the message and attachments
//---------------------------------------------------------
envelope = MessageExternalizeUtils.readExternal(in, this, getLogIDString());
//---------------------------------------------------------
// ArrayList executionChain
// handler and phase related data
//---------------------------------------------------------
// Restore the metadata about each member of the list
// and the order of the list.
// This metadata will be used to match up with phases
// and handlers on the engine.
//
// Non-null list:
// UTF - description string
// boolean - active flag
// int - current handler index
// int - current phase index
// int - expected number of entries in the list
// not including the last entry marker
// objects - MetaDataEntry object per list entry
// last entry will be empty MetaDataEntry
// with MetaDataEntry.LAST_ENTRY marker
// int - adjusted number of entries in the list
// includes the last empty entry
//
// Empty list:
// UTF - description string
// boolean - empty flag
//---------------------------------------------------------
// the local chain is not enabled until the
// list has been reconstituted
executionChain = null;
currentHandlerIndex = -1;
currentPhaseIndex = 0;
metaExecutionChain = null;
String marker = in.readUTF();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read executionChain, marker is: " + marker);
}
boolean gotChain = in.readBoolean();
if (gotChain == ExternalizeConstants.ACTIVE_OBJECT) {
metaHandlerIndex = in.readInt();
metaPhaseIndex = in.readInt();
int expectedNumberEntries = in.readInt();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): execution chain: expected number of entries [" +
expectedNumberEntries + "]");
}
// setup the list
metaExecutionChain = new ArrayList< MetaDataEntry >();
// process the objects
boolean keepGoing = true;
int count = 0;
while (keepGoing) {
// stop when we get to the end-of-list marker
// get the object
Object tmpObj = in.readObject();
count++;
MetaDataEntry mdObj = (MetaDataEntry) tmpObj;
// get the class name, then add it to the list
String tmpClassNameStr;
String tmpQNameAsStr;
if (mdObj != null) {
tmpClassNameStr = mdObj.getClassName();
if (tmpClassNameStr.equalsIgnoreCase(MetaDataEntry.END_OF_LIST)) {
// this is the last entry
keepGoing = false;
} else {
// add the entry to the meta data list
metaExecutionChain.add(mdObj);
tmpQNameAsStr = mdObj.getQNameAsString();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
String tmpHasList = mdObj.isListEmpty() ? "no children" : "has children";
if (log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): meta data class [" + tmpClassNameStr +
"] qname [" + tmpQNameAsStr + "] index [" + count + "] [" +
tmpHasList + "]");
}
}
}
} else {
// some error occurred
keepGoing = false;
}
} // end while keep going
int adjustedNumberEntries = in.readInt();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): adjusted number of entries ExecutionChain [" +
adjustedNumberEntries + "] ");
}
}
if ((metaExecutionChain == null) || (metaExecutionChain.isEmpty())) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): meta data for Execution Chain is NULL");
}
}
//---------------------------------------------------------
// LinkedList executedPhases
//
// Note that in previous versions of Axis2, this was
// represented by two lists: "inboundExecutedPhases", "outboundExecutedPhases",
// however since the message context itself represents a flow
// direction, one of these lists was always null. This was changed
// around 2007-06-08 revision r545615. For backward compatability
// with streams saved in previous versions of Axis2, we need
// to be able to process both the old style and new style.
//---------------------------------------------------------
// Restore the metadata about each member of the list
// and the order of the list.
// This metadata will be used to match up with phases
// and handlers on the engine.
//
// Non-null list:
// UTF - description string
// boolean - active flag
// int - expected number of entries in the list
// not including the last entry marker
// objects - MetaDataEntry object per list entry
// last entry will be empty MetaDataEntry
// with MetaDataEntry.LAST_ENTRY marker
// int - adjusted number of entries in the list
// includes the last empty entry
//
// Empty list:
// UTF - description string
// boolean - empty flag
//---------------------------------------------------------
// the local chain is not enabled until the
// list has been reconstituted
executedPhases = null;
metaExecuted = null;
marker = in.readUTF();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read executedPhases, marker is: " + marker);
}
// Previous versions of Axis2 saved two phases in the stream, although one should
// always have been null. The two phases and their associated markers are, in this order:
// "inboundExecutedPhases", "outboundExecutedPhases".
boolean gotInExecList = in.readBoolean();
boolean oldStyleExecutedPhases = false;
if (marker.equals("inboundExecutedPhases")) {
oldStyleExecutedPhases = true;
}
if (oldStyleExecutedPhases && (gotInExecList == ExternalizeConstants.EMPTY_OBJECT)) {
// There are an inboundExecutedPhases and an outboundExecutedPhases and this one
// is empty, so skip over it and read the next one
marker = in.readUTF();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): Skipping over oldStyle empty inboundExecutedPhases");
log.trace(getLogIDString() +
": readExternal(): About to read executedPhases, marker is: " + marker);
}
gotInExecList = in.readBoolean();
}
/*
* At this point, the stream should point to either "executedPhases" if this is the
* new style of serialization. If it is the oldStyle, it should point to whichever
* of "inbound" or "outbound" executed phases contains an active object, since only one
* should
*/
if (gotInExecList == ExternalizeConstants.ACTIVE_OBJECT) {
int expectedNumberInExecList = in.readInt();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): executed phases: expected number of entries [" +
expectedNumberInExecList + "]");
}
// setup the list
metaExecuted = new LinkedList< MetaDataEntry >();
// process the objects
boolean keepGoing = true;
int count = 0;
while (keepGoing) {
// stop when we get to the end-of-list marker
// get the object
Object tmpObj = in.readObject();
count++;
MetaDataEntry mdObj = (MetaDataEntry) tmpObj;
// get the class name, then add it to the list
String tmpClassNameStr;
String tmpQNameAsStr;
String tmpHasList = "no list";
if (mdObj != null) {
tmpClassNameStr = mdObj.getClassName();
if (tmpClassNameStr.equalsIgnoreCase(MetaDataEntry.END_OF_LIST)) {
// this is the last entry
keepGoing = false;
} else {
// add the entry to the meta data list
metaExecuted.add(mdObj);
tmpQNameAsStr = mdObj.getQNameAsString();
if (!mdObj.isListEmpty()) {
tmpHasList = "has list";
}
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): meta data class [" + tmpClassNameStr +
"] qname [" + tmpQNameAsStr + "] index [" + count + "] [" +
tmpHasList + "]");
}
}
} else {
// some error occurred
keepGoing = false;
}
} // end while keep going
int adjustedNumberInExecList = in.readInt();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): adjusted number of entries executedPhases [" +
adjustedNumberInExecList + "] ");
}
}
if ((metaExecuted == null) || (metaExecuted.isEmpty())) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): meta data for executedPhases list is NULL");
}
}
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): After reading executedPhases, marker is: " + marker);
}
// If this is an oldStyle that contained both an inbound and outbound executed phases,
// and the outbound phases wasn't read above, then we need to skip over it
if (marker.equals("outboundExecutedPhases")) {
Boolean gotOutExecList = in.readBoolean();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): Skipping over outboundExecutedPhases, marker is: " + marker +
", is list an active object: " + gotOutExecList);
}
if (gotOutExecList != ExternalizeConstants.EMPTY_OBJECT) {
throw new IOException("Both inboundExecutedPhases and outboundExecutedPhases had active objects");
}
marker = in.readUTF();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): After skipping ooutboundExecutePhases, marker is: " + marker);
}
}
//---------------------------------------------------------
// options
//---------------------------------------------------------
options = (Options) in.readObject();
if (options != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() + ":readExternal(): restored Options [" +
options.getLogCorrelationIDString() + "]");
}
}
//---------------------------------------------------------
// operation
//---------------------------------------------------------
// axisOperation is not usable until the meta data has been reconciled
axisOperation = null;
marker = in.readUTF(); // Read Marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read axisOperation, marker is: " + marker);
}
metaAxisOperation = (MetaDataEntry) in.readObject();
// operation context is not usable until it has been activated
// NOTE: expect this to be the parent
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read operationContext, marker is: " + marker);
}
operationContext = (OperationContext) in.readObject();
if (operationContext != null) {
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() + ":readExternal(): restored OperationContext [" +
operationContext.getLogCorrelationIDString() + "]");
}
}
//---------------------------------------------------------
// service
//---------------------------------------------------------
// axisService is not usable until the meta data has been reconciled
axisService = null;
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read axisService, marker is: " + marker);
}
metaAxisService = (MetaDataEntry) in.readObject();
//-------------------------
// serviceContextID string
//-------------------------
serviceContextID = (String) in.readObject();
//-------------------------
// serviceContext
//-------------------------
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read serviceContext, marker is: " + marker);
}
boolean servCtxActive = in.readBoolean();
if (servCtxActive == ExternalizeConstants.EMPTY_OBJECT) {
// empty object
serviceContext = null;
} else {
// active object
boolean isParent = in.readBoolean();
// there's an object to read in if it is not the parent of the operation context
if (!isParent) {
serviceContext = (ServiceContext) in.readObject();
} else {
// the service context is the parent of the operation context
// so get it from the operation context during activate
serviceContext = null;
}
}
//---------------------------------------------------------
// serviceGroup
//---------------------------------------------------------
// axisServiceGroup is not usable until the meta data has been reconciled
axisServiceGroup = null;
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read AxisServiceGroup, marker is: " + marker);
}
metaAxisServiceGroup = (MetaDataEntry) in.readObject();
//-----------------------------
// serviceGroupContextId string
//-----------------------------
serviceGroupContextId = (String) in.readObject();
//-----------------------------
// serviceGroupContext
//-----------------------------
marker = in.readUTF();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read ServiceGroupContext, marker is: " + marker);
}
boolean servGrpCtxActive = in.readBoolean();
if (servGrpCtxActive == ExternalizeConstants.EMPTY_OBJECT) {
// empty object
serviceGroupContext = null;
} else {
// active object
boolean isParentSGC = in.readBoolean();
// there's an object to read in if it is not the parent of the service group context
if (!isParentSGC) {
serviceGroupContext = (ServiceGroupContext) in.readObject();
} else {
// the service group context is the parent of the service context
// so get it from the service context during activate
serviceGroupContext = null;
}
}
//---------------------------------------------------------
// axis message
//---------------------------------------------------------
// axisMessage is not usable until the meta data has been reconciled
axisMessage = null;
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read AxisMessage, marker is: " + marker);
}
metaAxisMessage = (MetaDataEntry) in.readObject();
reconcileAxisMessage = (metaAxisMessage != null);
//---------------------------------------------------------
// configuration context
//---------------------------------------------------------
// TODO: check to see if there is any runtime data important to this
// message context in the configuration context
// if so, then need to restore the saved runtime data and reconcile
// it with the configuration context on the system when
// this message context object is restored
//---------------------------------------------------------
// session context
//---------------------------------------------------------
sessionContext = (SessionContext) in.readObject();
//---------------------------------------------------------
// transport
//---------------------------------------------------------
//------------------------------
// incomingTransportName string
//------------------------------
incomingTransportName = (String) in.readObject();
// TransportInDescription transportIn
// is not usable until the meta data has been reconciled
transportIn = null;
metaTransportIn = (MetaDataEntry) in.readObject();
// TransportOutDescription transportOut
// is not usable until the meta data has been reconciled
transportOut = null;
metaTransportOut = (MetaDataEntry) in.readObject();
//---------------------------------------------------------
// properties
//---------------------------------------------------------
// read local properties
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read properties, marker is: " + marker);
}
properties = in.readMap(new HashMapUpdateLockable());
//---------------------------------------------------------
// special data
//---------------------------------------------------------
marker = in.readUTF(); // Read marker
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
": readExternal(): About to read SpecialData, marker is: " + marker);
}
boolean gotSelfManagedData = in.readBoolean();
if (gotSelfManagedData == ExternalizeConstants.ACTIVE_OBJECT) {
selfManagedDataHandlerCount = in.readInt();
if (selfManagedDataListHolder == null) {
selfManagedDataListHolder = new ArrayList< SelfManagedDataHolder >();
} else {
selfManagedDataListHolder.clear();
}
for (int i = 0; i < selfManagedDataHandlerCount; i++) {
selfManagedDataListHolder.add((SelfManagedDataHolder) in.readObject());
}
}
//---------------------------------------------------------
// done
//---------------------------------------------------------
// trace point
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(getLogIDString() +
":readExternal(): message context object created for " +
getLogIDString());
}
}
Restore the contents of the MessageContext 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. |
public void removeAttachment(String contentID) {
if (attachments != null) {
attachments.removeDataHandler(contentID);
}
}
Removes the attachment with the given content ID from the Attachments Map
Do nothing if a attachment cannot be found by the given content ID. |
public void removeFirstExecutedPhase() {
if (executedPhases != null) {
executedPhases.removeFirst();
}
}
Remove the first Phase in the collection of executed phases |
public void removeSelfManagedData(Class clazz,
Object key) {
if (selfManagedDataMap != null) {
selfManagedDataMap.remove(generateSelfManagedDataKey(clazz, key));
}
}
Removes the mapping of the specified key if the specified key
has been set for self managed data |
public void resetExecutedPhases() {
executedPhasesReset = true;
executedPhases = new LinkedList< Handler >();
}
Reset the list of executed phases.
This is needed because the OutInAxisOperation currently invokes
receive() even when a fault occurs, and we will have already executed
the flowComplete on those before receiveFault() is called. |
public void setAttachmentMap(Attachments attachments) {
this.attachments = attachments;
}
Setting of the attachments map should be performed at the receipt of a
message only. This method is only meant to be used by the Axis2
internals. |
public void setAxisMessage(AxisMessage axisMessage) {
this.axisMessage = axisMessage;
}
|
public void setAxisOperation(AxisOperation axisOperation) {
this.axisOperation = axisOperation;
}
|
public void setAxisService(AxisService axisService) {
this.axisService = axisService;
if (this.axisService != null) {
this.axisServiceGroup = axisService.getAxisServiceGroup();
} else {
this.axisServiceGroup = null;
}
}
|
public void setAxisServiceGroup(AxisServiceGroup axisServiceGroup) {
// need to set the axis service group object to null when necessary
// for example, when extracting the message context object from
// the object graph
this.axisServiceGroup = axisServiceGroup;
}
|
public void setConfigurationContext(ConfigurationContext context) {
configurationContext = context;
}
|
public void setCurrentHandlerIndex(int currentHandlerIndex) {
this.currentHandlerIndex = currentHandlerIndex;
}
|
public static void setCurrentMessageContext(MessageContext ctx) {
currentMessageContext.set(ctx);
}
|
public void setCurrentPhaseIndex(int currentPhaseIndex) {
this.currentPhaseIndex = currentPhaseIndex;
}
|
public void setDoingMTOM(boolean b) {
doingMTOM = b;
}
|
public void setDoingREST(boolean b) {
doingREST = b;
}
|
public void setDoingSwA(boolean b) {
doingSwA = b;
}
|
public void setEnvelope(SOAPEnvelope envelope) throws AxisFault {
this.envelope = envelope;
if (this.envelope != null) {
String soapNamespaceURI = envelope.getNamespace().getNamespaceURI();
if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
.equals(soapNamespaceURI)) {
isSOAP11 = false;
} else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI
.equals(soapNamespaceURI)) {
isSOAP11 = true;
} else {
throw new AxisFault(
"Unknown SOAP Version. Current Axis handles only SOAP 1.1 and SOAP 1.2 messages");
}
// Inform the listeners of an attach envelope event
if (getAxisService() != null) {
getAxisService().attachEnvelopeEvent(this);
}
}
}
|
public void setExecutedPhasesExplicit(LinkedList inb) {
executedPhases = inb;
}
|
public void setExecutionChain(ArrayList executionChain) {
this.executionChain = executionChain;
currentHandlerIndex = -1;
currentPhaseIndex = 0;
}
Set the execution chain of Handler in this MessageContext. Doing this
causes the current handler/phase indexes to reset to 0, since we have new
Handlers to execute (this usually only happens at initialization and when
a fault occurs). |
public void setFLOW(int FLOW) {
this.FLOW = FLOW;
}
|
public void setFailureReason(Exception failureReason) {
this.failureReason = failureReason;
}
Set the failure reason. Only AxisEngine should ever do this. |
public void setFaultTo(EndpointReference reference) {
options.setFaultTo(reference);
}
|
public void setFrom(EndpointReference reference) {
options.setFrom(reference);
}
|
public void setIncomingTransportName(String incomingTransportName) {
this.incomingTransportName = incomingTransportName;
}
|
public void setIsSOAP11Explicit(boolean t) {
isSOAP11 = t;
}
|
public void setMessageID(String messageId) {
options.setMessageId(messageId);
}
|
public void setNewThreadRequired(boolean b) {
newThreadRequired = b;
}
|
public void setOperationContext(OperationContext context) {
// allow setting the fields to null
// useful when extracting the messge context from the object graph
operationContext = context;
this.setParent(operationContext);
if (operationContext != null) {
if (serviceContext == null) {
setServiceContext(operationContext.getServiceContext());
} else {
if (operationContext.getParent() != serviceContext) {
throw new AxisError("ServiceContext in OperationContext does not match !");
}
}
this.setAxisOperation(operationContext.getAxisOperation());
}
}
|
public void setOptions(Options options) {
this.options.setParent(options);
}
Set the options for myself. I make the given options my own options'
parent so that that becomes the default. That allows the user to override
specific options on a given message context and not affect the overall
options. |
public void setOptionsExplicit(Options op) {
this.options = op;
}
|
public void setOutputWritten(boolean b) {
outputWritten = b;
}
|
public void setPaused(boolean paused) {
this.paused = paused;
}
|
public void setProcessingFault(boolean b) {
processingFault = b;
}
|
public void setRelationships(RelatesTo[] list) {
options.setRelationships(list);
}
|
public void setReplyTo(EndpointReference reference) {
options.setReplyTo(reference);
}
|
public void setResponseWritten(boolean b) {
responseWritten = b;
}
|
public void setSelfManagedData(Class clazz,
Object key,
Object value) {
if (selfManagedDataMap == null) {
selfManagedDataMap = new LinkedHashMap< String, Object >();
}
// make sure we have a unique key and a delimiter so we can
// get the classname and hashcode for serialization/deserialization
selfManagedDataMap.put(generateSelfManagedDataKey(clazz, key), value);
}
Add a key-value pair of self managed data to the set associated with
this message context.
This is primarily intended to allow handlers to manage their own
message-specific data when the message context is saved/restored. |
public void setSelfManagedDataMapExplicit(LinkedHashMap map) {
selfManagedDataMap = map;
}
|
public void setServerSide(boolean b) {
serverSide = b;
}
|
public void setServiceContext(ServiceContext context) {
// allow the service context to be set to null
// this allows the message context object to be extraced from
// the object graph
serviceContext = context;
if (serviceContext != null) {
if ((operationContext != null)
&& (operationContext.getParent() != context)) {
throw new AxisError("ServiceContext and OperationContext.parent do not match!");
}
// setting configcontext using configuration context in service context
if (configurationContext == null) {
// setting configcontext
configurationContext = context.getConfigurationContext();
}
if (serviceGroupContext == null) {
// setting service group context
serviceGroupContext = context.getServiceGroupContext();
}
AxisService axisService = context.getAxisService();
this.setAxisService(axisService);
// Inform the listeners of an attach event
if (axisService != null) {
axisService.attachServiceContextEvent(serviceContext, this);
}
}
}
|
public void setServiceContextID(String serviceContextID) {
this.serviceContextID = serviceContextID;
}
Sets the service context id. |
public void setServiceGroupContext(ServiceGroupContext serviceGroupContext) {
// allow the service group context to be set to null
// this allows the message context object to be extraced from
// the object graph
this.serviceGroupContext = serviceGroupContext;
if (this.serviceGroupContext != null) {
this.axisServiceGroup = serviceGroupContext.getDescription();
}
}
|
public void setServiceGroupContextId(String serviceGroupContextId) {
this.serviceGroupContextId = serviceGroupContextId;
}
|
public void setSessionContext(SessionContext sessionContext) {
this.sessionContext = sessionContext;
}
|
public void setSoapAction(String soapAction) {
options.setAction(soapAction);
}
|
public void setTo(EndpointReference to) {
options.setTo(to);
}
|
public void setTransportIn(TransportInDescription in) {
this.transportIn = in;
}
|
public void setTransportOut(TransportOutDescription out) {
transportOut = out;
}
|
public void setWSAAction(String actionURI) {
options.setAction(actionURI);
}
|
public void setWSAMessageId(String messageID) {
options.setMessageId(messageID);
}
|
public String toString() {
return getLogIDString();
}
|
public void writeExternal(ObjectOutput o) throws IOException {
SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
String logCorrelationIDString = getLogIDString();
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":writeExternal(): writing to output stream");
}
//---------------------------------------------------------
// in order to handle future changes to the message
// context definition, be sure to maintain the
// object level identifiers
//---------------------------------------------------------
// serialization version ID
out.writeLong(serialVersionUID);
// revision ID
out.writeInt(revisionID);
//---------------------------------------------------------
// various simple fields
//---------------------------------------------------------
// the type of execution flow for the message context
out.writeInt(FLOW);
// various flags
out.writeBoolean(processingFault);
out.writeBoolean(paused);
out.writeBoolean(outputWritten);
out.writeBoolean(newThreadRequired);
out.writeBoolean(isSOAP11);
out.writeBoolean(doingREST);
out.writeBoolean(doingMTOM);
out.writeBoolean(doingSwA);
out.writeBoolean(responseWritten);
out.writeBoolean(serverSide);
out.writeLong(getLastTouchedTime());
out.writeObject(getLogCorrelationID());
//-----------------------------------------------------------------------
// Create and initialize the OMOutputFormat for Message Externalization
//-----------------------------------------------------------------------
OMOutputFormat outputFormat= new OMOutputFormat();
outputFormat.setSOAP11(isSOAP11);
boolean persistOptimized = getPersistOptimized();
if (persistOptimized) {
outputFormat.setDoOptimize(true);
}
String charSetEnc = (String) getProperty(MessageContext.CHARACTER_SET_ENCODING);
if (charSetEnc == null) {
OperationContext opContext = getOperationContext();
if (opContext != null) {
charSetEnc =
(String) opContext.getProperty(MessageContext.CHARACTER_SET_ENCODING);
}
}
if (charSetEnc == null) {
charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING;
}
outputFormat.setCharSetEncoding(charSetEnc);
// ----------------------------------------------------------
// Externalize the Message
// ----------------------------------------------------------
MessageExternalizeUtils.writeExternal(out, this, logCorrelationIDString, outputFormat);
// ---------------------------------------------------------
// ArrayList executionChain
// handler and phase related data
//---------------------------------------------------------
// The strategy is to save some metadata about each
// member of the list and the order of the list.
// Then when the message context is re-constituted,
// try to match up with phases and handlers on the
// engine.
//
// Non-null list:
// UTF - description string
// boolean - active flag
// int - current handler index
// int - current phase index
// int - expected number of entries in the list
// objects - MetaDataEntry object per list entry
// last entry will be empty MetaDataEntry
// with MetaDataEntry.LAST_ENTRY marker
// int - adjusted number of entries in the list
// includes the last empty entry
//
// Empty list:
// UTF - description string
// boolean - empty flag
//---------------------------------------------------------
out.writeUTF("executionChain");
if (executionChain != null && executionChain.size() > 0) {
// start writing data to the output stream
out.writeBoolean(ExternalizeConstants.ACTIVE_OBJECT);
out.writeInt(currentHandlerIndex);
out.writeInt(currentPhaseIndex);
out.writeInt(executionChain.size());
// put the metadata on each member of the list into a buffer
// match the current index with the actual saved list
int nextIndex = 0;
Iterator< Handler > i = executionChain.iterator();
while (i.hasNext()) {
Object obj = i.next();
String objClass = obj.getClass().getName();
// start the meta data entry for this object
MetaDataEntry mdEntry = new MetaDataEntry();
mdEntry.setClassName(objClass);
// get the correct object-specific name
String qnameAsString;
if (obj instanceof Phase) {
Phase phaseObj = (Phase) obj;
qnameAsString = phaseObj.getName();
// add the list of handlers to the meta data
setupPhaseList(phaseObj, mdEntry);
} else if (obj instanceof Handler) {
Handler handlerObj = (Handler) obj;
qnameAsString = handlerObj.getName();
} else {
// TODO: will there be any other kinds of objects in the execution Chain?
qnameAsString = "NULL";
}
mdEntry.setQName(qnameAsString);
// update the index for the entry in the chain
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":writeExternal(): ***BEFORE OBJ WRITE*** executionChain entry class [" +
objClass + "] qname [" + qnameAsString + "]");
}
out.writeObject(mdEntry);
// update the index so that the index
// now indicates the next entry that
// will be attempted
nextIndex++;
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":writeExternal(): ***AFTER OBJ WRITE*** executionChain entry class [" +
objClass + "] qname [" + qnameAsString + "]");
}
} // end while entries in execution chain
// done with the entries in the execution chain
// add the end-of-list marker
MetaDataEntry lastEntry = new MetaDataEntry();
lastEntry.setClassName(MetaDataEntry.END_OF_LIST);
out.writeObject(lastEntry);
nextIndex++;
// nextIndex also gives us the number of entries
// that were actually saved as opposed to the
// number of entries in the executionChain
out.writeInt(nextIndex);
} else {
// general case: handle "null" or "empty"
out.writeBoolean(ExternalizeConstants.EMPTY_OBJECT);
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":writeExternal(): executionChain is NULL");
}
}
//---------------------------------------------------------
// LinkedList executedPhases
//---------------------------------------------------------
// The strategy is to save some metadata about each
// member of the list and the order of the list.
// Then when the message context is re-constituted,
// try to match up with phases and handlers on the
// engine.
//
// Non-null list:
// UTF - description string
// boolean - active flag
// int - expected number of entries in the list
// objects - MetaDataEntry object per list entry
// last entry will be empty MetaDataEntry
// with MetaDataEntry.LAST_ENTRY marker
// int - adjusted number of entries in the list
// includes the last empty entry
//
// Empty list:
// UTF - description string
// boolean - empty flag
//---------------------------------------------------------
out.writeUTF("executedPhases");
if (executedPhases != null && executedPhases.size() > 0) {
// start writing data to the output stream
out.writeBoolean(ExternalizeConstants.ACTIVE_OBJECT);
out.writeInt(executedPhases.size());
// put the metadata on each member of the list into a buffer
int execNextIndex = 0;
Iterator< Handler > iterator = executedPhases.iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
String objClass = obj.getClass().getName();
// start the meta data entry for this object
MetaDataEntry mdEntry = new MetaDataEntry();
mdEntry.setClassName(objClass);
// get the correct object-specific name
String qnameAsString;
if (obj instanceof Phase) {
Phase inPhaseObj = (Phase) obj;
qnameAsString = inPhaseObj.getName();
// add the list of handlers to the meta data
setupPhaseList(inPhaseObj, mdEntry);
} else if (obj instanceof Handler) {
Handler inHandlerObj = (Handler) obj;
qnameAsString = inHandlerObj.getName();
} else {
// TODO: will there be any other kinds of objects in the list
qnameAsString = "NULL";
}
mdEntry.setQName(qnameAsString);
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":writeExternal(): ***BEFORE Executed List OBJ WRITE*** executedPhases entry class [" +
objClass + "] qname [" + qnameAsString + "]");
}
out.writeObject(mdEntry);
// update the index so that the index
// now indicates the next entry that
// will be attempted
execNextIndex++;
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":writeExternal(): " +
"***AFTER Executed List OBJ WRITE*** " +
"executedPhases entry class [" + objClass + "] " +
"qname [" + qnameAsString + "]");
}
} // end while entries in execution chain
// done with the entries in the execution chain
// add the end-of-list marker
MetaDataEntry lastEntry = new MetaDataEntry();
lastEntry.setClassName(MetaDataEntry.END_OF_LIST);
out.writeObject(lastEntry);
execNextIndex++;
// execNextIndex also gives us the number of entries
// that were actually saved as opposed to the
// number of entries in the executedPhases
out.writeInt(execNextIndex);
} else {
// general case: handle "null" or "empty"
out.writeBoolean(ExternalizeConstants.EMPTY_OBJECT);
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(
logCorrelationIDString + ":writeExternal(): executedPhases is NULL");
}
}
//---------------------------------------------------------
// options
//---------------------------------------------------------
// before saving the Options, make sure there is a message ID
String tmpID = getMessageID();
if (tmpID == null) {
// get an id to use when restoring this object
tmpID = UUIDGenerator.getUUID();
setMessageID(tmpID);
}
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString + ":writeExternal(): message ID [" + tmpID + "]");
}
out.writeUTF("options");
out.writeObject(options);
//---------------------------------------------------------
// operation
//---------------------------------------------------------
// axis operation
//---------------------------------------------------------
out.writeUTF("axisOperation");
metaAxisOperation = null;
if (axisOperation != null) {
// TODO: may need to include the meta data for the axis service that is
// the parent of the axis operation
// make sure the axis operation has a name associated with it
QName aoTmpQName = axisOperation.getName();
if (aoTmpQName == null) {
aoTmpQName = new QName(ExternalizeConstants.EMPTY_MARKER);
axisOperation.setName(aoTmpQName);
}
metaAxisOperation = new MetaDataEntry(axisOperation.getClass().getName(),
axisOperation.getName().toString());
}
out.writeObject(metaAxisOperation);
//---------------------------------------------------------
// operation context
//---------------------------------------------------------
// The OperationContext has pointers to MessageContext objects.
// In order to avoid having multiple copies of the object graph
// being saved at different points in the serialization,
// it is important to isolate this message context object.
out.writeUTF("operationContext");
if (operationContext != null) {
operationContext.isolateMessageContext(this);
}
out.writeObject(operationContext);
//---------------------------------------------------------
// service
//---------------------------------------------------------
// axis service
//-------------------------
// this is expected to be the parent of the axis operation object
out.writeUTF("axisService");
metaAxisService = null;
if (axisService != null) {
metaAxisService = new MetaDataEntry(axisService.getClass().getName(),
axisService.getName());
}
out.writeObject(metaAxisService);
//-------------------------
// serviceContextID string
//-------------------------
out.writeObject(serviceContextID);
//-------------------------
// serviceContext
//-------------------------
// is this the same as the parent of the OperationContext?
boolean isParent = false;
out.writeUTF("serviceContext");
if (operationContext != null) {
ServiceContext opctxParent = operationContext.getServiceContext();
if (serviceContext != null) {
if (serviceContext.equals(opctxParent)) {
// the ServiceContext is the parent of the OperationContext
isParent = true;
}
}
}
if (serviceContext == null) {
out.writeBoolean(ExternalizeConstants.EMPTY_OBJECT);
} else {
out.writeBoolean(ExternalizeConstants.ACTIVE_OBJECT);
out.writeBoolean(isParent);
// only write out the object if it is not the parent
if (!isParent) {
out.writeObject(serviceContext);
}
}
//---------------------------------------------------------
// axisServiceGroup
//---------------------------------------------------------
out.writeUTF("axisServiceGroup");
metaAxisServiceGroup = null;
if (axisServiceGroup != null) {
metaAxisServiceGroup = new MetaDataEntry(axisServiceGroup.getClass().getName(),
axisServiceGroup.getServiceGroupName());
}
out.writeObject(metaAxisServiceGroup);
//-----------------------------
// serviceGroupContextId string
//-----------------------------
out.writeObject(serviceGroupContextId);
//-------------------------
// serviceGroupContext
//-------------------------
// is this the same as the parent of the ServiceContext?
isParent = false;
out.writeUTF("serviceGroupContext");
if (serviceContext != null) {
ServiceGroupContext srvgrpctxParent = (ServiceGroupContext) serviceContext.getParent();
if (serviceGroupContext != null) {
if (serviceGroupContext.equals(srvgrpctxParent)) {
// the ServiceGroupContext is the parent of the ServiceContext
isParent = true;
}
}
}
if (serviceGroupContext == null) {
out.writeBoolean(ExternalizeConstants.EMPTY_OBJECT);
} else {
out.writeBoolean(ExternalizeConstants.ACTIVE_OBJECT);
out.writeBoolean(isParent);
// only write out the object if it is not the parent
if (!isParent) {
out.writeObject(serviceGroupContext);
}
}
//---------------------------------------------------------
// axis message
//---------------------------------------------------------
out.writeUTF("axisMessage");
metaAxisMessage = null;
if (axisMessage != null) {
// This AxisMessage is expected to belong to the AxisOperation
// that has already been recorded for this MessageContext.
// If an AxisMessage associated with this Messagecontext is
// associated with a different AxisOperation, then more
// meta information would need to be saved
// make sure the axis message has a name associated with it
String amTmpName = axisMessage.getName();
if (amTmpName == null) {
amTmpName = ExternalizeConstants.EMPTY_MARKER;
axisMessage.setName(amTmpName);
}
// get the element name if there is one
QName amTmpElementQName = axisMessage.getElementQName();
String amTmpElemQNameString = null;
if (amTmpElementQName != null) {
amTmpElemQNameString = amTmpElementQName.toString();
}
metaAxisMessage = new MetaDataEntry(axisMessage.getClass().getName(),
axisMessage.getName(), amTmpElemQNameString);
}
out.writeObject(metaAxisMessage);
//---------------------------------------------------------
// configuration context
//---------------------------------------------------------
// NOTE: Currently, there does not seem to be any
// runtime data important to this message context
// in the configuration context.
// if so, then need to save that runtime data and reconcile
// it with the configuration context on the system when
// this message context object is restored
//---------------------------------------------------------
// session context
//---------------------------------------------------------
out.writeObject(sessionContext);
//---------------------------------------------------------
// transport
//---------------------------------------------------------
//------------------------------
// incomingTransportName string
//------------------------------
out.writeObject(incomingTransportName);
// TransportInDescription transportIn
metaTransportIn = null;
if (transportIn != null) {
metaTransportIn = new MetaDataEntry(null, transportIn.getName());
}
out.writeObject(metaTransportIn);
// TransportOutDescription transportOut
metaTransportOut = null;
if (transportOut != null) {
metaTransportOut = new MetaDataEntry(null, transportOut.getName());
}
out.writeObject(metaTransportOut);
//---------------------------------------------------------
// properties
//---------------------------------------------------------
// Write out the local properties on the MessageContext
// Don't write out the properties from other hierarchical layers.
// (i.e. don't use getProperties())
out.writeUTF("properties"); // write marker
out.writeMap(properties);
//---------------------------------------------------------
// special data
//---------------------------------------------------------
out.writeUTF("selfManagedData");
serializeSelfManagedData(out);
//---------------------------------------------------------
// done
//---------------------------------------------------------
if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
log.trace(logCorrelationIDString +
":writeExternal(): completed writing to output stream for " +
logCorrelationIDString);
}
}
Save the contents of this MessageContext instance.
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. |