From b55bad231eba7a750c94e0fcfea8212260bff1f0 Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 25 Aug 2010 15:02:01 +0000 Subject: TUSCANY-3659 - Enable asynch operation over the local SCA binding. This does what I think is the right thing but it doesn't necessarily do it in an optimal way yet. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@989157 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/implementation/java/invocation/ResponseDispatchImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/implementation-java-runtime/src/main') diff --git a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java index 0d56a6ef9d..dc0bb94bde 100644 --- a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java +++ b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java @@ -63,6 +63,7 @@ public class ResponseDispatchImpl implements ResponseDispatch, Serializabl */ private static final long serialVersionUID = 300158355992568592L; private static String WS_MESSAGE_ID = "WS_MESSAGE_ID"; + private static String MESSAGE_ID = "MESSAGE_ID"; // A latch used to ensure that the sendResponse() and sendFault() operations are used at most once // The latch is initialized with the value "false" @@ -87,7 +88,12 @@ public class ResponseDispatchImpl implements ResponseDispatch, Serializabl callbackRef = getAsyncCallbackRef( msg ); callbackAddress = msg.getFrom().getCallbackEndpoint().getURI(); - messageID = (String) msg.getHeaders().get(WS_MESSAGE_ID); + + // TODO - why is WS stuff bleeding into general code? + messageID = (String) msg.getHeaders().get(MESSAGE_ID); + if (messageID == null){ + messageID = (String) msg.getHeaders().get(WS_MESSAGE_ID); + } } // end constructor @@ -206,6 +212,7 @@ public class ResponseDispatchImpl implements ResponseDispatch, Serializabl // Add in the header for the RelatesTo Message ID msgContext.getHeaders().put(WS_MESSAGE_ID, messageID); + msgContext.getHeaders().put(MESSAGE_ID, messageID); ThreadMessageContext.setMessageContext(msgContext); } // end method setResponseHeaders -- cgit v1.2.3