synCtx.setProperty(name, resultValue);
} else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)
&& synCtx instanceof Axis2MessageContext) {
//Setting property into the Axis2 Message Context
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2smc.getAxis2MessageContext();
axis2MessageCtx.setProperty(name, resultValue);
} else if (XMLConfigConstants.SCOPE_CLIENT.equals(scope)
&& synCtx instanceof Axis2MessageContext) {
//Setting property into the Axis2 Message Context client options
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2smc.getAxis2MessageContext();
axis2MessageCtx.getOptions().setProperty(name, resultValue);
} else if (XMLConfigConstants.SCOPE_TRANSPORT.equals(scope)
&& synCtx instanceof Axis2MessageContext) {
//Setting Transport Headers
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2smc.getAxis2MessageContext();
Object headers = axis2MessageCtx.getProperty(
org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
if (headers != null && headers instanceof Map) {
Map headersMap = (Map) headers;
headersMap.put(name, resultValue);
}
if (headers == null) {
Map headersMap = new HashMap();
headersMap.put(name, resultValue);
axis2MessageCtx.setProperty(
org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS,
headersMap);
}
}
} else {
if (synLog.isTraceOrDebugEnabled()) {
synLog.traceOrDebug("Removing property : " + name +
" (scope:" + (scope == null ? "default" : scope) + ")");
}
if (scope == null || XMLConfigConstants.SCOPE_DEFAULT.equals(scope)) {
//Removing property from the Synapse Context
Set pros = synCtx.getPropertyKeySet();
if (pros != null) {
pros.remove(name);
}
} else if ((XMLConfigConstants.SCOPE_AXIS2.equals(scope) ||
XMLConfigConstants.SCOPE_CLIENT.equals(scope))
&& synCtx instanceof Axis2MessageContext) {
//Removing property from the Axis2 Message Context
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2smc.getAxis2MessageContext();
axis2MessageCtx.removeProperty(name);
} else if (XMLConfigConstants.SCOPE_TRANSPORT.equals(scope)
&& synCtx instanceof Axis2MessageContext) {
// Removing transport headers
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2smc.getAxis2MessageContext();
Object headers = axis2MessageCtx.getProperty(
org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
if (headers != null && headers instanceof Map) {
Map headersMap = (Map) headers;
headersMap.remove(name);