From ccf294e5056997e5eb3ff6bf8674d7942cb5f3f0 Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 3 Dec 2010 14:59:54 +0000 Subject: TUSCANY-3801 - allow endpoints to report when they are configured for async invocation. Correct comment on endpoint reference version of the operation. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1041845 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/assembly/Endpoint.java | 9 +++++++++ .../apache/tuscany/sca/assembly/EndpointReference.java | 4 ++-- .../apache/tuscany/sca/assembly/impl/EndpointImpl.java | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java index 43bf17d66a..ec16b20b6e 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java @@ -136,4 +136,13 @@ public interface Endpoint extends Base, PolicySubject, Cloneable, Serializable { */ boolean matches(String serviceURI); + /** + * When true this endpoint is able to process the invocation + * asynchronously. The forward call is effectively one-way + * and the response will arrive asynchronously + * + * @return true if the service is asynchronous + */ + boolean isAsyncInvocation(); + } diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java index 2fc8eebe4d..c70d4521ba 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java @@ -165,8 +165,8 @@ public interface EndpointReference extends Base, PolicySubject, Cloneable, Seria /** * When true this endpoint reference is able to process the invocation - * as being asynchronous. The forward call is effectively one-way - * and the response will arrive asynchronously via the CallbackEndpoint + * asynchronously. The forward call is effectively one-way + * and the response will arrive asynchronously * * @return true if the reference is asynchronous */ diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java index e25bd4206b..f4a8429f13 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java @@ -279,5 +279,20 @@ public class EndpointImpl implements Endpoint { } return names; } + + public boolean isAsyncInvocation() { + if (service.getName().endsWith("_asyncCallback")){ + // this is a response service at the reference component so don't create a + // response reference. + return false; + } + + for(Intent intent : getRequiredIntents()){ + if (intent.getName().getLocalPart().equals("asyncInvocation")){ + return true; + } + } + return false; + } } -- cgit v1.2.3