You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2017/11/15 12:03:11 UTC

[cxf] branch master updated: Minor update to RxJava2 invoker

This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new cc07d8f  Minor update to RxJava2 invoker
cc07d8f is described below

commit cc07d8f8b17e4933ec695a054f56b25cd67f4bfd
Author: Sergey Beryozkin <sb...@gmail.com>
AuthorDate: Wed Nov 15 12:02:56 2017 +0000

    Minor update to RxJava2 invoker
---
 .../java/org/apache/cxf/jaxrs/rx2/server/ReactiveIOInvoker.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rt/rs/extensions/rx/src/main/java/org/apache/cxf/jaxrs/rx2/server/ReactiveIOInvoker.java b/rt/rs/extensions/rx/src/main/java/org/apache/cxf/jaxrs/rx2/server/ReactiveIOInvoker.java
index c529d4a..8e8512c 100644
--- a/rt/rs/extensions/rx/src/main/java/org/apache/cxf/jaxrs/rx2/server/ReactiveIOInvoker.java
+++ b/rt/rs/extensions/rx/src/main/java/org/apache/cxf/jaxrs/rx2/server/ReactiveIOInvoker.java
@@ -18,6 +18,8 @@
  */
 package org.apache.cxf.jaxrs.rx2.server;
 
+import java.util.concurrent.CancellationException;
+
 import org.apache.cxf.jaxrs.JAXRSInvoker;
 import org.apache.cxf.jaxrs.impl.AsyncResponseImpl;
 import org.apache.cxf.message.Message;
@@ -50,8 +52,11 @@ public class ReactiveIOInvoker extends JAXRSInvoker {
     }
 
     private Object handleThrowable(AsyncResponseImpl asyncResponse, Throwable t) {
-        //TODO: if it is a Cancelation exception => asyncResponse.cancel(); 
-        asyncResponse.resume(t);
+        if (t instanceof CancellationException) {
+            asyncResponse.cancel();
+        } else {
+            asyncResponse.resume(t);
+        }
         return null;
     }
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].