diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-27 20:41:53 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-27 20:41:53 +0000 |
commit | 1c3d230b1a82d805893f93ac7e9f82dcd414382f (patch) | |
tree | 81e84fe2ac1bcafa8540918cb653d3e2299f212c | |
parent | 98b9c9677994d63c3bddbcfeea0c2ed6a6fea075 (diff) |
More fixes to get invocations working when a node is restarted
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@808613 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java index d49cd70035..6bd7ebd301 100644 --- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java +++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java @@ -41,6 +41,7 @@ import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.oasisopen.sca.SCARuntimeException; import org.oasisopen.sca.ServiceReference; import org.oasisopen.sca.ServiceRuntimeException; @@ -148,6 +149,7 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { // the service node has gone so clear and rebuild and try invoke again wire.rebuild(); chains.clear(); + try { InvocationChain chain = getInvocationChain(method, wire); if (chain == null) { @@ -157,11 +159,24 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { // The EndpointReference is not now resolved until the invocation chain // is first created so reset the source here source = wire.getEndpointReference(); - + // send the invocation down the wire Object result = invoke(chain, args, wire, source); return result; + } catch (SCARuntimeException e1) { + // this can be thrown by getInvocationChain if the endpoint isn't available + // clean up so a later request can work + wire.rebuild(); + chains.clear(); + throw e1; + } catch (TargetResolutionException e2) { + //this can be thrown by the invoke if the endpoint has disapeared + // clean up so a later request can work + wire.rebuild(); + chains.clear(); + throw e2; + } } } |