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 2013/02/19 12:00:13 UTC

svn commit: r1447668 - in /cxf/branches/2.7.x-fixes/rt: frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/conti...

Author: sergeyb
Date: Tue Feb 19 11:00:12 2013
New Revision: 1447668

URL: http://svn.apache.org/r1447668
Log:
[CXF-4817] Merging some of the changes to 2.7.x

Modified:
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/branches/2.7.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java?rev=1447668&r1=1447667&r2=1447668&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java (original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java Tue Feb 19 11:00:12 2013
@@ -245,5 +245,7 @@ public class AsyncResponseImpl implement
         initContinuation();
     }
     
-    
+    public void reset() {
+        cont.reset();
+    }    
 }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1447668&r1=1447667&r2=1447668&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java (original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java Tue Feb 19 11:00:12 2013
@@ -53,6 +53,7 @@ import org.apache.cxf.common.util.ClassH
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.jaxrs.ext.ResponseHandler;
+import org.apache.cxf.jaxrs.impl.AsyncResponseImpl;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.WriterInterceptorMBW;
 import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
@@ -102,6 +103,10 @@ public class JAXRSOutInterceptor extends
             if (cri != null) {
                 cri.clearThreadLocalProxies();
             }
+            AsyncResponse ar = (AsyncResponse)message.getExchange().get(AsyncResponse.class);
+            if (ar != null) {
+                ((AsyncResponseImpl)ar).reset();
+            } 
         }
             
 

Modified: cxf/branches/2.7.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java?rev=1447668&r1=1447667&r2=1447668&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java (original)
+++ cxf/branches/2.7.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java Tue Feb 19 11:00:12 2013
@@ -81,7 +81,12 @@ public class JettyContinuationWrapper im
     }
 
     public void reset() {
-        continuation.complete();
+        try {
+            continuation.complete();
+        } catch (Throwable ex) {
+            // explicit complete call does not seem to work 
+            // with the non-Servlet3 Jetty Continuation
+        }
         obj = null;
         pendingTimeout = 0;
     }