You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2010/12/20 20:28:05 UTC

svn commit: r1051250 - in /tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca: invocation/InterceptorAsync.java invocation/InvokerAsyncRequest.java runtime/Invocable.java

Author: edwardsmj
Date: Mon Dec 20 19:28:04 2010
New Revision: 1051250

URL: http://svn.apache.org/viewvc?rev=1051250&view=rev
Log:
Updating core invocation code to support bindings that provide native async support - as described in TUSCANY-3801

Modified:
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java?rev=1051250&r1=1051249&r2=1051250&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InterceptorAsync.java Mon Dec 20 19:28:04 2010
@@ -47,16 +47,36 @@ public interface InterceptorAsync extend
      * 
      */
     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

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java?rev=1051250&r1=1051249&r2=1051250&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsyncRequest.java Mon Dec 20 19:28:04 2010
@@ -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;   
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java?rev=1051250&r1=1051249&r2=1051250&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java Mon Dec 20 19:28:04 2010
@@ -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
      */