You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/06/02 15:22:14 UTC

svn commit: r950555 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/endpoint/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/simple/src/main/java/org/apache/cxf/frontend/

Author: dkulp
Date: Wed Jun  2 13:22:13 2010
New Revision: 950555

URL: http://svn.apache.org/viewvc?rev=950555&view=rev
Log:
Merged revisions 950554 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r950554 | dkulp | 2010-06-02 09:20:41 -0400 (Wed, 02 Jun 2010) | 1 line
  
  Push older annotation processing up a level so jaxrs can use it
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/AbstractEndpointFactory.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/branches/2.2.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java

Propchange: cxf/branches/2.2.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/AbstractEndpointFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/AbstractEndpointFactory.java?rev=950555&r1=950554&r2=950555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/AbstractEndpointFactory.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/AbstractEndpointFactory.java Wed Jun  2 13:22:13 2010
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 
@@ -30,9 +31,11 @@ import org.apache.cxf.BusException;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.BindingConfiguration;
 import org.apache.cxf.binding.BindingFactory;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
+import org.apache.cxf.interceptor.AnnotationInterceptors;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -40,7 +43,7 @@ import org.apache.cxf.transport.Destinat
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
 public abstract class AbstractEndpointFactory extends AbstractBasicInterceptorProvider {
-    
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractEndpointFactory.class);
     private static final String PRIVATE_ENDPOINT = "org.apache.cxf.endpoint.private";
     private static final String PRIVATE_ENDPOINTS = "org.apache.cxf.private.endpoints";
     
@@ -211,4 +214,41 @@ public abstract class AbstractEndpointFa
         }
         return false;
     }
+    
+    /**
+     * Add annotationed Interceptors and Features to the Endpoint
+     * @param ep
+     */
+    protected void initializeAnnotationInterceptors(Endpoint ep, Class<?> cls) {
+        AnnotationInterceptors provider = new AnnotationInterceptors(cls);
+        if (initializeAnnotationInterceptors(provider, ep)) {
+            LOG.fine("Added annotation based interceptors and features");
+        }
+    }    
+    
+    protected boolean initializeAnnotationInterceptors(AnnotationInterceptors provider, Endpoint ep) {
+        boolean hasAnnotation = false;
+        if (provider.getInFaultInterceptors() != null) {
+            ep.getInFaultInterceptors().addAll(provider.getInFaultInterceptors());
+            hasAnnotation = true;
+        }
+        if (provider.getInInterceptors() != null) {
+            ep.getInInterceptors().addAll(provider.getInInterceptors());
+            hasAnnotation = true;
+        }
+        if (provider.getOutFaultInterceptors() != null) {
+            ep.getOutFaultInterceptors().addAll(provider.getOutFaultInterceptors());
+            hasAnnotation = true;
+        }
+        if (provider.getOutInterceptors() != null) {
+            ep.getOutInterceptors().addAll(provider.getOutInterceptors());
+            hasAnnotation = true;
+        }
+        if (provider.getFeatures() != null) {
+            getFeatures().addAll(provider.getFeatures());
+            hasAnnotation = true;
+        }
+        
+        return hasAnnotation;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=950555&r1=950554&r2=950555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java Wed Jun  2 13:22:13 2010
@@ -184,6 +184,12 @@ public class AbstractJAXRSFactoryBean ex
         if (getOutFaultInterceptors() != null) {
             ep.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
         }
+        
+        List<ClassResourceInfo> list = serviceFactory.getRealClassResourceInfo();
+        for (ClassResourceInfo cri : list) {
+            initializeAnnotationInterceptors(ep, cri.getServiceClass());
+        }
+            
         return ep;
     }
     

Modified: cxf/branches/2.2.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java?rev=950555&r1=950554&r2=950555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java Wed Jun  2 13:22:13 2010
@@ -32,7 +32,6 @@ import org.apache.cxf.endpoint.AbstractE
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.endpoint.EndpointImpl;
-import org.apache.cxf.interceptor.AnnotationInterceptors;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractServiceConfiguration;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -328,42 +327,7 @@ public abstract class AbstractWSDLBasedE
         return ei;
     }
 
-    /**
-     * Add annotationed Interceptors and Features to the Endpoint
-     * @param ep
-     */
-    protected void initializeAnnotationInterceptors(Endpoint ep, Class<?> cls) {
-        AnnotationInterceptors provider = new AnnotationInterceptors(cls);
-        if (initializeAnnotationInterceptors(provider, ep)) {
-            LOG.fine("Added annotation based interceptors and features");
-        }
-    }    
     
-    protected boolean initializeAnnotationInterceptors(AnnotationInterceptors provider, Endpoint ep) {
-        boolean hasAnnotation = false;
-        if (provider.getInFaultInterceptors() != null) {
-            ep.getInFaultInterceptors().addAll(provider.getInFaultInterceptors());
-            hasAnnotation = true;
-        }
-        if (provider.getInInterceptors() != null) {
-            ep.getInInterceptors().addAll(provider.getInInterceptors());
-            hasAnnotation = true;
-        }
-        if (provider.getOutFaultInterceptors() != null) {
-            ep.getOutFaultInterceptors().addAll(provider.getOutFaultInterceptors());
-            hasAnnotation = true;
-        }
-        if (provider.getOutInterceptors() != null) {
-            ep.getOutInterceptors().addAll(provider.getOutInterceptors());
-            hasAnnotation = true;
-        }
-        if (provider.getFeatures() != null) {
-            getFeatures().addAll(provider.getFeatures());
-            hasAnnotation = true;
-        }
-        
-        return hasAnnotation;
-    }
     protected SoapBindingConfiguration createSoapBindingConfig() {
         return new SoapBindingConfiguration();
     }