summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/modules
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2011-03-29 21:31:15 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2011-03-29 21:31:15 +0000
commit8b87e3bcaa96fd5444dc127cab0048d47c574b28 (patch)
tree6de92c4feb3151f95c8f2fcaf4950ad2d0586569 /sca-java-1.x/trunk/modules
parent1a2fe860fa6f790b95a0ea5978ee7f1a40c06c0c (diff)
TUSCANY-3838: call PolicyHandler.afterInvoke() when AxisFault is thrown
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1086757 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk/modules')
-rw-r--r--sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
index 4087bd80a5..023e3da43e 100644
--- a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
+++ b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
@@ -164,6 +164,7 @@ public class Axis2BindingInvoker implements Invoker, DataExchangeSemantics {
Axis2BindingHeaderConfigurator.setHeader(requestMC, msg, axis2TokenAuthenticationPolicy.getTokenName());
}
+ MessageContext responseMC = null;
// Allow privileged access to read properties. Requires PropertiesPermission read in
// security policy.
try {
@@ -176,12 +177,13 @@ public class Axis2BindingInvoker implements Invoker, DataExchangeSemantics {
} catch (PrivilegedActionException e) {
operationClient.complete(requestMC);
throw (AxisFault)e.getException();
- }
-
- MessageContext responseMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ } finally {
+ // TUSCANY-3838: call afterInvoke() on both normal and exception paths
+ responseMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.afterInvoke(msg, responseMC, operationClient);
+ for ( PolicyHandler policyHandler : policyHandlerList ) {
+ policyHandler.afterInvoke(msg, responseMC, operationClient);
+ }
}
OMElement response = responseMC.getEnvelope().getBody().getFirstElement();