cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1540201 - in /cxf/trunk: core/src/main/java/org/apache/cxf/validation/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/
Date Fri, 08 Nov 2013 21:45:38 GMT
Author: sergeyb
Date: Fri Nov  8 21:45:37 2013
New Revision: 1540201

URL: http://svn.apache.org/r1540201
Log:
[CXF-5308,CXF-5309] Removing Simple interceptors, making abstract in/put interceptors as public
and ready to use when a service object can be injected

Added:
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationInInterceptor.java
      - copied, changed from r1539064, cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInInterceptor.java
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationOutInterceptor.java
      - copied, changed from r1539064, cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationOutInterceptor.java
Removed:
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInInterceptor.java
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationOutInterceptor.java
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/SimpleValidationInInterceptor.java
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/SimpleValidationOutInterceptor.java
Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
    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/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java?rev=1540201&r1=1540200&r2=1540201&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
Fri Nov  8 21:45:37 2013
@@ -36,11 +36,16 @@ import org.apache.cxf.service.model.Bind
 public abstract class AbstractValidationInterceptor extends AbstractPhaseInterceptor<
Message > {
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractValidationInterceptor.class);
     
+    private Object serviceObject;
     private volatile ValidationProvider provider;
     
     public AbstractValidationInterceptor(String phase) {
         super(phase);
     }
+        
+    public void setServiceObject(Object object) {
+        this.serviceObject = object;
+    }
     
     public void setProvider(ValidationProvider provider) {
         this.provider = provider;
@@ -48,16 +53,16 @@ public abstract class AbstractValidation
     
     @Override
     public void handleMessage(Message message) throws Fault {        
-        final Object resourceInstance = getResourceInstance(message);
-        if (resourceInstance == null) {
-            String error = "Resource instance is not available";
+        final Object theServiceObject = getServiceObject(message);
+        if (theServiceObject == null) {
+            String error = "Service object is not available";
             LOG.severe(error);
             throw new ValidationException(error);
         }
         
-        final Method method = getResourceMethod(message);
+        final Method method = getServiceMethod(message);
         if (method == null) {
-            String error = "Resource method is not available";
+            String error = "Service method is not available";
             LOG.severe(error);
             throw new ValidationException(error);
         }
@@ -65,13 +70,15 @@ public abstract class AbstractValidation
         
         final List< Object > arguments = MessageContentsList.getContentsList(message);
         
-        handleValidation(message, resourceInstance, method, arguments);
+        handleValidation(message, theServiceObject, method, arguments);
                     
     }
     
-    protected abstract Object getResourceInstance(Message message);
+    protected Object getServiceObject(Message message) {
+        return serviceObject;
+    }
     
-    protected Method getResourceMethod(Message message) {
+    protected Method getServiceMethod(Message message) {
         Message inMessage = message.getExchange().getInMessage();
         Method method = (Method)inMessage.get("org.apache.cxf.resource.method");
         if (method == null) {

Copied: cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationInInterceptor.java
(from r1539064, cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInInterceptor.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationInInterceptor.java?p2=cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationInInterceptor.java&p1=cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInInterceptor.java&r1=1539064&r2=1540201&rev=1540201&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationInInterceptor.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationInInterceptor.java Fri
Nov  8 21:45:37 2013
@@ -24,11 +24,11 @@ import java.util.List;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 
-public abstract class AbstractValidationInInterceptor extends AbstractValidationInterceptor
{
-    public AbstractValidationInInterceptor() {
+public class ValidationInInterceptor extends AbstractValidationInterceptor {
+    public ValidationInInterceptor() {
         super(Phase.PRE_INVOKE);
     }
-    public AbstractValidationInInterceptor(String phase) {
+    public ValidationInInterceptor(String phase) {
         super(phase);
     }
 

Copied: cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationOutInterceptor.java
(from r1539064, cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationOutInterceptor.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationOutInterceptor.java?p2=cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationOutInterceptor.java&p1=cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationOutInterceptor.java&r1=1539064&r2=1540201&rev=1540201&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/validation/AbstractValidationOutInterceptor.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationOutInterceptor.java Fri
Nov  8 21:45:37 2013
@@ -24,11 +24,11 @@ import java.util.List;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 
-public abstract class AbstractValidationOutInterceptor extends AbstractValidationInterceptor
{
-    public AbstractValidationOutInterceptor() {
+public class ValidationOutInterceptor extends AbstractValidationInterceptor {
+    public ValidationOutInterceptor() {
         super(Phase.PRE_MARSHAL);
     }
-    public AbstractValidationOutInterceptor(String phase) {
+    public ValidationOutInterceptor(String phase) {
         super(phase);
     }
     

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=1540201&r1=1540200&r2=1540201&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
Fri Nov  8 21:45:37 2013
@@ -26,10 +26,10 @@ import javax.ws.rs.container.ContainerRe
 
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-import org.apache.cxf.validation.AbstractValidationInInterceptor;
+import org.apache.cxf.validation.ValidationInInterceptor;
 
 
-public class JAXRSValidationInInterceptor extends AbstractValidationInInterceptor 
+public class JAXRSValidationInInterceptor extends ValidationInInterceptor 
     implements ContainerRequestFilter {
     public JAXRSValidationInInterceptor() {
     }
@@ -38,16 +38,16 @@ public class JAXRSValidationInIntercepto
     }
 
     @Override
-    protected Object getResourceInstance(Message message) {
+    protected Object getServiceObject(Message message) {
         return ValidationUtils.getResourceInstance(message);
     }
     
     @Override
-    protected Method getResourceMethod(Message message) {
+    protected Method getServiceMethod(Message message) {
         if (!ValidationUtils.isAnnotatedMethodAvailable(message)) {
             return null;
         } else {
-            return super.getResourceMethod(message);
+            return super.getServiceMethod(message);
         }
     }
     @Override

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=1540201&r1=1540200&r2=1540201&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
Fri Nov  8 21:45:37 2013
@@ -30,10 +30,10 @@ import javax.ws.rs.core.Response;
 
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-import org.apache.cxf.validation.AbstractValidationOutInterceptor;
+import org.apache.cxf.validation.ValidationOutInterceptor;
 
 
-public class JAXRSValidationOutInterceptor extends AbstractValidationOutInterceptor
+public class JAXRSValidationOutInterceptor extends ValidationOutInterceptor
     implements ContainerResponseFilter {
     public JAXRSValidationOutInterceptor() {
     }
@@ -42,16 +42,16 @@ public class JAXRSValidationOutIntercept
     }
     
     @Override
-    protected Object getResourceInstance(Message message) {
+    protected Object getServiceObject(Message message) {
         return ValidationUtils.getResourceInstance(message);
     }
     
     @Override
-    protected Method getResourceMethod(Message message) {
+    protected Method getServiceMethod(Message message) {
         if (!ValidationUtils.isAnnotatedMethodAvailable(message)) {
             return null;
         } else {
-            return super.getResourceMethod(message);
+            return super.getServiceMethod(message);
         }
     }
     



Mime
View raw message