cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1539330 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation: JAXRSValidationInInterceptor.java JAXRSValidationOutInterceptor.java
Date Wed, 06 Nov 2013 13:08:33 GMT
Author: sergeyb
Date: Wed Nov  6 13:08:32 2013
New Revision: 1539330

URL: http://svn.apache.org/r1539330
Log:
[CXF-5309] Getting JAXRS interceptors also impement 2.0 filters so that they can be applied
from DynamicFeature

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationInInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationOutInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationInInterceptor.java?rev=1539330&r1=1539329&r2=1539330&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationInInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationInInterceptor.java
Wed Nov  6 13:08:32 2013
@@ -18,13 +18,19 @@
  */
 package org.apache.cxf.jaxrs.validation;
 
+import java.io.IOException;
 import java.lang.reflect.Method;
 
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+
 import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.validation.AbstractValidationInInterceptor;
 
 
-public class JAXRSValidationInInterceptor extends AbstractValidationInInterceptor {
+public class JAXRSValidationInInterceptor extends AbstractValidationInInterceptor 
+    implements ContainerRequestFilter {
     public JAXRSValidationInInterceptor() {
     }
     public JAXRSValidationInInterceptor(String phase) {
@@ -44,4 +50,9 @@ public class JAXRSValidationInIntercepto
             return super.getResourceMethod(message);
         }
     }
+    @Override
+    public void filter(ContainerRequestContext context) throws IOException {
+        super.handleMessage(PhaseInterceptorChain.getCurrentMessage());
+        
+    }
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationOutInterceptor.java?rev=1539330&r1=1539329&r2=1539330&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSValidationOutInterceptor.java
Wed Nov  6 13:08:32 2013
@@ -18,16 +18,22 @@
  */
 package org.apache.cxf.jaxrs.validation;
 
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.List;
 
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
 import javax.ws.rs.core.Response;
 
 import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.validation.AbstractValidationOutInterceptor;
 
 
-public class JAXRSValidationOutInterceptor extends AbstractValidationOutInterceptor {
+public class JAXRSValidationOutInterceptor extends AbstractValidationOutInterceptor
+    implements ContainerResponseFilter {
     public JAXRSValidationOutInterceptor() {
     }
     public JAXRSValidationOutInterceptor(String phase) {
@@ -59,4 +65,8 @@ public class JAXRSValidationOutIntercept
             }
         }        
     }
+    @Override
+    public void filter(ContainerRequestContext in, ContainerResponseContext out) throws IOException
{
+        super.handleMessage(PhaseInterceptorChain.getCurrentMessage());
+    }
 }



Mime
View raw message