cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1438077 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: JAXRSInvoker.java interceptor/JAXRSInInterceptor.java
Date Thu, 24 Jan 2013 17:17:06 GMT
Author: sergeyb
Date: Thu Jan 24 17:17:06 2013
New Revision: 1438077

URL: http://svn.apache.org/viewvc?rev=1438077&view=rev
Log:
Getting post-match ClientRequestFilters running before ReaderInterceptors

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=1438077&r1=1438076&r2=1438077&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Thu Jan
24 17:17:06 2013
@@ -144,14 +144,6 @@ public class JAXRSInvoker extends Abstra
         
         if (!wasSuspended) {
             
-            // Global and name-bound request filters
-            if (!ori.isSubResourceLocator() && JAXRSUtils.runContainerRequestFilters(
-                                                  providerFactory,
-                                                  exchange.getInMessage(),
-                                                  false, ori.getNameBindings())) {
-                return new MessageContentsList(exchange.get(Response.class));
-            }
-            
             pushOntoStack(ori, ClassHelper.getRealClass(resourceObject), inMessage);
             
             final boolean contextsAvailable = cri.contextsAvailable();
@@ -213,16 +205,15 @@ public class JAXRSInvoker extends Abstra
         ClassResourceInfo subCri = null;
         if (ori.isSubResourceLocator()) {
             try {
-                Message msg = exchange.getInMessage();
-                MultivaluedMap<String, String> values = getTemplateValues(msg);
+                MultivaluedMap<String, String> values = getTemplateValues(inMessage);
                 String subResourcePath = values.getFirst(URITemplate.FINAL_MATCH_GROUP);
-                String httpMethod = (String)msg.get(Message.HTTP_REQUEST_METHOD);
-                String contentType = (String)msg.get(Message.CONTENT_TYPE);
+                String httpMethod = (String)inMessage.get(Message.HTTP_REQUEST_METHOD);
+                String contentType = (String)inMessage.get(Message.CONTENT_TYPE);
                 if (contentType == null) {
                     contentType = "*/*";
                 }
                 List<MediaType> acceptContentType =
-                    (List<MediaType>)msg.getExchange().get(Message.ACCEPT_CONTENT_TYPE);
+                    (List<MediaType>)exchange.get(Message.ACCEPT_CONTENT_TYPE);
 
                 result = checkResultObject(result, subResourcePath);
 
@@ -238,18 +229,25 @@ public class JAXRSInvoker extends Abstra
                 }
 
                 OperationResourceInfo subOri = JAXRSUtils.findTargetMethod(subCri,
-                                                         exchange.getInMessage(),
+                                                         inMessage,
                                                          httpMethod,
                                                          values,
                                                          contentType,
                                                          acceptContentType,
                                                          true);
                 exchange.put(OperationResourceInfo.class, subOri);
-                msg.put(URITemplate.TEMPLATE_PARAMETERS, values);
+                inMessage.put(URITemplate.TEMPLATE_PARAMETERS, values);
+            
+                if (JAXRSUtils.runContainerRequestFilters(providerFactory,
+                                                      inMessage,
+                                                      false, subOri.getNameBindings())) {
+                    return new MessageContentsList(exchange.get(Response.class));
+                }
+                
                 // work out request parameters for the sub-resource class. Here we
                 // presume InputStream has not been consumed yet by the root resource class.
-                List<Object> newParams = JAXRSUtils.processParameters(subOri, values,
msg);
-                msg.setContent(List.class, newParams);
+                List<Object> newParams = JAXRSUtils.processParameters(subOri, values,
inMessage);
+                inMessage.setContent(List.class, newParams);
 
                 return this.invoke(exchange, newParams, result);
             } catch (IOException ex) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1438077&r1=1438076&r2=1438077&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Thu Jan 24 17:17:06 2013
@@ -222,6 +222,15 @@ public class JAXRSInInterceptor extends 
         
         setExchangeProperties(message, ori, values, resources.size());
         
+        // Global and name-bound post-match request filters
+        if (JAXRSUtils.runContainerRequestFilters(providerFactory,
+                                                  message,
+                                                  false, 
+                                                  ori.getNameBindings())) {
+            return;
+        }
+        
+        
         //Process parameters
         try {
             List<Object> params = JAXRSUtils.processParameters(ori, values, message);



Mime
View raw message