Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void evaluate(MessageContext synCtx) {

if (scope == null || XMLConfigConstants.SCOPE_DEFAULT.equals(scope)) {
synCtx.setProperty(name, result);
MediatorPropertyUtils.handleSpecialProperties(name, result, synCtx);
} else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)) {
//Setting property into the Axis2 Message Context
Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public boolean mediate(MessageContext synCtx) {
}

synCtx.setProperty(name, resultValue);
MediatorPropertyUtils.handleSpecialProperties(name, resultValue, synCtx);

} else if (XMLConfigConstants.SCOPE_TRACE.equals(scope)) {
//Setting property value into the propertyValue variable for tracing purposes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.synapse.AckDecisionSetter;
import org.apache.synapse.MessageContext;
import org.apache.synapse.SynapseConstants;
import org.apache.synapse.core.axis2.Axis2MessageContext;
import org.apache.synapse.endpoints.EndpointDefinition;
import org.apache.synapse.unittest.ConfigModifier;

Expand Down Expand Up @@ -56,33 +55,6 @@ public static void handleSpecialProperties(String propertyName, Object resultVal
headers.put(HTTP.CONTENT_TYPE, resultValue);
}
}
if (SynapseConstants.SET_ROLLBACK_ONLY.equals(propertyName)) {
axis2MessageCtx.getOperationContext().setProperty(propertyName, resultValue);
}
}

/**
* Handles specific message context properties that require special treatment during mediation.
* <p>
* In particular, this method checks if the provided property is {@code SET_ROLLBACK_ONLY},
* which is used to indicate that the current transaction should be rolled back. If so,
* the property is explicitly set in the Axis2 {@link org.apache.axis2.context.OperationContext},
* ensuring that the rollback state is preserved across cloned message contexts and
* is accessible from the original inbound message context.
*
* @param propertyName the name of the property to handle (e.g., {@code SET_ROLLBACK_ONLY})
* @param resultValue the value to associate with the property
* @param synapseMessageCtx the Synapse message context, from which the Axis2 message context is derived
*/
public static void handleSpecialProperties(String propertyName, Object resultValue,
MessageContext synapseMessageCtx) {

Axis2MessageContext axis2smc = (Axis2MessageContext) synapseMessageCtx;
org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();

if (SynapseConstants.SET_ROLLBACK_ONLY.equals(propertyName)) {
axis2MessageCtx.getOperationContext().setProperty(propertyName, resultValue);
}
}

/**
Expand Down
Loading