summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2010-12-20 19:28:04 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2010-12-20 19:28:04 +0000
commitd7ebda787739f6e362f958250887961946a92f02 (patch)
treefccb0e7c390072b71ef0d8e53da9184ecd0905ce
parent3c7130f5e2a0ef58e77997fd70b678172d2e1cce (diff)
Updating core invocation code to support bindings that provide native async support - as described in TUSCANY-3801
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1051250 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java26
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java3
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java9
3 files changed, 34 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java
index 806feccca2..f29dfddf6a 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java
@@ -47,16 +47,36 @@ public interface InterceptorAsync extends Interceptor, InvokerAsyncRequest, Invo
*
*/
Message processRequest(Message msg);
+
+ /**
+ * Post processing for a request message. Intended to be called after
+ * the invocation of the request chain returns, to permit cleanup/error handling
+ * if required
+ * @param msg The request Message
+ * @return the processed message
+ */
+ Message postProcessRequest(Message msg);
+
+ /**
+ * Post processing for a request message where an exception was thrown.
+ * Intended to be called after the invocation of the request chain returns,
+ * to permit cleanup/error handling if required
+ * @param msg The request Message
+ * @param e a Thowable which is some form of exception thrown during the processing
+ * of the request message by the invocation chain
+ * @return the processed message
+ */
+ Message postProcessRequest(Message msg, Throwable e) throws Throwable;
/**
* Process a response message. Provided so that the synchronous
* and asynchronous patterns can re-use the response message
* processing
*
- * @param msg The request Message
+ * @param msg The response Message
* @return the processed message
*
*/
Message processResponse(Message msg);
-
-}
+
+} // end interface InterceptorAsync
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java
index 48fad02b53..025010a076 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java
@@ -32,8 +32,9 @@ public interface InvokerAsyncRequest {
*
* @param msg The request Message
* @return the processed message
+ * @throws Throwable
*
*/
- void invokeAsyncRequest(Message msg);
+ void invokeAsyncRequest(Message msg) throws Throwable;
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
index 948063f480..eef7a88046 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
@@ -140,6 +140,15 @@ public interface Invocable {
/**
* Asynchronously invoke an operation with a context message
+ * This invoke method assumes that the binding invocation chain is in force
+ * and that there will be an operation selector element there to
+ * determine which operation to call
+ * @param msg The request message
+ */
+ void invokeAsync(Message msg);
+
+ /**
+ * Asynchronously invoke an operation with a context message
* @param tailInvoker the invoker at the end of the chain
* @param msg The request message
*/