cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1537942 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/
Date Fri, 01 Nov 2013 14:19:19 GMT
Author: sergeyb
Date: Fri Nov  1 14:19:19 2013
New Revision: 1537942

URL: http://svn.apache.org/r1537942
Log:
Merged revisions 1537939 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1537939 | sergeyb | 2013-11-01 14:08:06 +0000 (Fri, 01 Nov 2013) | 1 line
  
  [CXF-5371] Updating JAXRSInInterceptor to skip the rest of the in chain if Response is ready
........

Added:
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ResponseCheckInterceptor.java
      - copied unchanged from r1537939, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ResponseCheckInterceptor.java
Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1537939

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1537942&r1=1537941&r2=1537942&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Fri Nov  1 14:19:19 2013
@@ -93,8 +93,12 @@ public class JAXRSInInterceptor extends 
         } catch (RuntimeException ex) {
             convertExceptionToResponseIfPossible(ex, message);
         }
-        
-        
+        Response r = message.getExchange().get(Response.class);
+        if (r != null) {
+            createOutMessage(message, r);
+            message.getInterceptorChain().doInterceptStartingAt(message,
+                                                                OutgoingChainInterceptor.class.getName());
+        }
     }
     
     private void processRequest(Message message) {
@@ -304,14 +308,7 @@ public class JAXRSInInterceptor extends 
                     message.put(FaultListener.class.getName(), new NoOpFaultListener());
                 }
                 
-                Endpoint e = message.getExchange().get(Endpoint.class);
-                Message mout = new MessageImpl();
-                mout.setContent(List.class, new MessageContentsList(r));
-                mout.setExchange(message.getExchange());
-                mout = e.getBinding().createMessage(mout);
-                mout.setInterceptorChain(OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange()));
-                message.getExchange().setOutMessage(mout);
-                
+                createOutMessage(message, r);
                 
                 Iterator<Interceptor<? extends Message>> iterator = message.getInterceptorChain().iterator();
                 while (iterator.hasNext()) {
@@ -342,4 +339,16 @@ public class JAXRSInInterceptor extends 
             cri.clearThreadLocalProxies();
         }
     }
+    
+    private Message createOutMessage(Message inMessage, Response r) {
+        Endpoint e = inMessage.getExchange().get(Endpoint.class);
+        Message mout = new MessageImpl();
+        mout.setContent(List.class, new MessageContentsList(r));
+        mout.setExchange(inMessage.getExchange());
+        mout = e.getBinding().createMessage(mout);
+        mout.setInterceptorChain(
+             OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange()));
+        inMessage.getExchange().setOutMessage(mout);
+        return mout;
+    }
 }

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml?rev=1537942&r1=1537941&r2=1537942&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
Fri Nov  1 14:19:19 2013
@@ -45,6 +45,9 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
         <jaxrs:serviceBeans>
             <ref bean="petstore"/>
         </jaxrs:serviceBeans>
+        <jaxrs:inInterceptors>
+           <bean class="org.apache.cxf.systest.jaxrs.ResponseCheckInterceptor"/>
+        </jaxrs:inInterceptors>
         <jaxrs:providers>
             <bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
                 <property name="marshallAsJaxbElement" value="true"/>



Mime
View raw message