diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-14 14:55:35 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-14 14:55:35 +0000 |
commit | 07cc642e106cc93a14d06f9297bfd25b51f10f95 (patch) | |
tree | 8955e9b661b85f2674d330d56da2121fbad69d7b | |
parent | ee8d2b72e816783c5632ae3608bc93ad69165435 (diff) |
TUSCANY-3801 - make the non-blocking interceptor work with native async bindings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1059030 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java index a31a126977..7108728206 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java @@ -38,7 +38,7 @@ import org.oasisopen.sca.ServiceRuntimeException; * * @version $Rev$ $Date$ */ -public class NonBlockingInterceptor implements Interceptor { +public class NonBlockingInterceptor extends InterceptorAsyncImpl { private static final Message RESPONSE = new ImmutableMessage(); @@ -48,7 +48,6 @@ public class NonBlockingInterceptor implements Interceptor { private static final Logger LOGGER = Logger.getLogger(NonBlockingInterceptor.class.getName()); private WorkScheduler workScheduler; - private Invoker next; public NonBlockingInterceptor(WorkScheduler workScheduler) { this.workScheduler = workScheduler; @@ -69,6 +68,11 @@ public class NonBlockingInterceptor implements Interceptor { this.workScheduler = workScheduler; } + /** + * For request/response messages use the workScheduler to break the connection between + * requests and the void response + */ + @Override public Message invoke(final Message msg) { // Schedule the invocation of the next interceptor in a new Work instance try { @@ -107,13 +111,21 @@ public class NonBlockingInterceptor implements Interceptor { } return RESPONSE; } - - public Invoker getNext() { - return next; + + /** + * For forward async responses we just pass the message along + * as this is naturally one way + */ + public Message processRequest(Message msg) { + return msg; } - - public void setNext(Invoker next) { - this.next = next; + + /** + * This should never be called as a one way message won't + * expect a response + */ + public Message processResponse(Message msg) { + return null; } /** |