diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 17:50:13 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 17:50:13 +0000 |
commit | 161690f7e21dfa89fcdab4bb47dbb5dd03ae3c0f (patch) | |
tree | 910d5c3ac3f0fd685c93878eeb830dce03922e3c | |
parent | d9750f8b94440fb9507b96b4db5e527a38dbc41a (diff) |
Fix for TUSCANY-3348 (perf improvement)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
3 files changed, 19 insertions, 4 deletions
diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java index fc6d7abf6a..7d94e73f35 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java @@ -370,7 +370,7 @@ public class CallableReferenceImpl<B> implements CallableReference<B>, Externali } this.proxyFactory = compositeActivator.getProxyFactory(); } - } else { + } else if (compositeActivator == null || proxyFactory == null) { this.compositeActivator = ComponentContextHelper.getCurrentCompositeActivator(); if (this.compositeActivator != null) { this.proxyFactory = this.compositeActivator.getProxyFactory(); diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java index cade0499d3..62e8b4d3ee 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java @@ -24,8 +24,11 @@ import java.lang.reflect.Method; import org.apache.tuscany.sca.core.assembly.RuntimeWireImpl; import org.apache.tuscany.sca.core.context.CallableReferenceImpl; import org.apache.tuscany.sca.core.conversation.ConversationState; +import org.apache.tuscany.sca.core.scope.TargetResolutionException; import org.apache.tuscany.sca.invocation.InvocationChain; +import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; +import org.apache.tuscany.sca.runtime.ReferenceParameters; import org.apache.tuscany.sca.runtime.RuntimeWire; import org.osoa.sca.NoRegisteredCallbackException; import org.osoa.sca.ServiceRuntimeException; @@ -106,5 +109,16 @@ public class JDKCallbackInvocationHandler extends JDKInvocationHandler { ((RuntimeWireImpl)wire).releaseWire(); } } + + /** + * + */ + @Override + protected void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID) + throws TargetResolutionException { + ReferenceParameters parameters = msg.getFrom().getReferenceParameters(); + parameters.setCallbackID(getCallbackID()); + } + } diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java index bb9595bf9c..80650b2804 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java @@ -381,14 +381,15 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { * @param interfaze * @throws TargetResolutionException */ - private void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID) + protected void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID) throws TargetResolutionException { - ReferenceParameters parameters = msg.getFrom().getReferenceParameters(); - parameters.setCallbackID(getCallbackID()); + if (msg.getFrom() == null || msg.getFrom().getCallbackEndpoint() == null) { return; } + ReferenceParameters parameters = msg.getFrom().getReferenceParameters(); + parameters.setCallbackID(getCallbackID()); parameters.setCallbackReference(msg.getFrom().getCallbackEndpoint()); // If we are passing out a callback target |