cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r556425 - in /incubator/cxf/trunk/rt: bindings/http/src/main/java/org/apache/cxf/binding/http/ bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ frontend/simple/src/...
Date Sun, 15 Jul 2007 16:31:17 GMT
Author: dandiep
Date: Sun Jul 15 09:31:16 2007
New Revision: 556425

URL: http://svn.apache.org/viewvc?view=rev&rev=556425
Log:
Fix bug with HTTP Binding whereby it wasn't looking at the endpoint interface for the @HttpResource
annotations when using JAX-WS

Modified:
    incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingFactory.java
    incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/JRAStrategy.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingFactory.java?view=diff&rev=556425&r1=556424&r2=556425
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingFactory.java
Sun Jul 15 09:31:16 2007
@@ -40,6 +40,8 @@
 import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.StaxOutInterceptor;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.OperationInfo;
@@ -94,6 +96,17 @@
             info.addOperation(bop);
             
             Method m = md.getMethod(bop);
+            
+            try {
+                Class c = (Class) service.get(ReflectionServiceFactoryBean.ENDPOINT_CLASS);
+                if (c != null) {
+                    m = c.getMethod(m.getName(), m.getParameterTypes());
+                }
+            } catch (SecurityException e) {
+                throw new ServiceConstructionException(e);
+            } catch (NoSuchMethodException e) {
+                throw new ServiceConstructionException(e);
+            }
             
             // attempt to map the method to a resource using different strategies
             for (ResourceStrategy s : strategies) {

Modified: incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/JRAStrategy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/JRAStrategy.java?view=diff&rev=556425&r1=556424&r2=556425
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/JRAStrategy.java
(original)
+++ incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/strategy/JRAStrategy.java
Sun Jul 15 09:31:16 2007
@@ -19,6 +19,7 @@
 package org.apache.cxf.binding.http.strategy;
 
 import java.lang.reflect.Method;
+import java.util.logging.Logger;
 
 import org.apache.cxf.binding.http.URIMapper;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -38,7 +39,8 @@
  * <a href="http://jra.codehaus.org">Java Rest Annotations</a>.
  */
 public class JRAStrategy implements ResourceStrategy {
-
+    private static final Logger LOG = Logger.getLogger(JRAStrategy.class.getName());
+    
     public boolean map(BindingOperationInfo bop, Method m, URIMapper mapper) {
         HttpResource r = m.getAnnotation(HttpResource.class);
         if (r == null) {
@@ -60,6 +62,8 @@
         
         mapper.bind(bop, r.location(), verb);
         
+        LOG.info("Mapping method " + m.getName() + " to resource " + r.location() + " and
verb " + verb);
+
         return true;
     }
     

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=556425&r1=556424&r2=556425
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Sun Jul 15 09:31:16 2007
@@ -54,8 +54,6 @@
 
     private JaxWsImplementorInfo implInfo;
     
-    
-    
     public JaxWsServiceConfiguration() {
         
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=556425&r1=556424&r2=556425
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Sun Jul 15 09:31:16 2007
@@ -85,6 +85,15 @@
     }
 
     @Override
+    public org.apache.cxf.service.Service create() {
+        org.apache.cxf.service.Service s = super.create();
+        
+        s.put(ENDPOINT_CLASS, implInfo.getEndpointClass());
+        
+        return s;
+    }
+
+    @Override
     protected Invoker createInvoker() {
         return null;
     }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=556425&r1=556424&r2=556425
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Sun Jul 15 09:31:16 2007
@@ -90,6 +90,7 @@
  */
 public class ReflectionServiceFactoryBean extends AbstractServiceFactoryBean {
 
+    public static final String ENDPOINT_CLASS = "endpoint.class";
     public static final String GENERIC_TYPE = "generic.type";
     public static final String MODE_OUT = "messagepart.mode.out";
     public static final String MODE_INOUT = "messagepart.mode.inout";



Mime
View raw message