diff options
3 files changed, 26 insertions, 2 deletions
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; + } } |