summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-12-03 14:59:54 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-12-03 14:59:54 +0000
commitccf294e5056997e5eb3ff6bf8674d7942cb5f3f0 (patch)
tree5ba265aec44899c74917994ed448cc3eeed00982 /sca-java-2.x/trunk/modules
parent1a206d215b186fc87acd7c7662dbc2d29b974557 (diff)
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
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java9
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java4
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java15
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;
+ }
}