diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-21 07:22:12 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-21 07:22:12 +0000 |
commit | e721aa978d542d7f7668d9027affaafccfa8bab5 (patch) | |
tree | f00672b79c2ec5b74b17c3ddefd56e4af909b3c0 /sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java | |
parent | 1f91615143cc34ad7eeffc7d91b6ffec9d7d0271 (diff) |
Tweaks and extensions to better match the async service implementation in core + JMS binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1051397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java')
-rw-r--r-- | sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java b/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java index 0fc8403cf1..176dac6b15 100644 --- a/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java +++ b/sca-java-2.x/trunk/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java @@ -22,6 +22,8 @@ package sample.impl; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; @@ -50,7 +52,7 @@ class SampleWSDLProxy implements WSDLReference { this.ep = ep; mf = ep.getExtensionPoint(MessageFactory.class); repr = (RuntimeEndpointReference)epr; - ops = new HashMap<String, Operation>(); + ops = new ConcurrentHashMap<String, Operation>(); for(Operation o: wi.getOperations()) ops.put(o.getName(), o); } @@ -71,9 +73,9 @@ class SampleWSDLProxy implements WSDLReference { Message message = mf.createMessage(); message.setBody(new Object[]{e}); - // We could MESSAGE_ID here if required. If not the infrastructure - // will generate a UUID - String messageID = "myuniqueid"; + // Generate MESSAGE_ID here. + // String messageID = "myuniqueid"; + String messageID = UUID.randomUUID().toString(); message.getHeaders().put(Constants.MESSAGE_ID, messageID); // save the message id ready for when we process the response @@ -88,9 +90,5 @@ class SampleWSDLProxy implements WSDLReference { ex.printStackTrace(); } - // if we don't provide a message id we can get the one the - // infrastructure generates - //String messageID = (String) message.getHeaders().get(Constants.MESSAGE_ID); - //asyncMessageMap.put(messageID, op); } } |