You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2012/07/11 09:44:09 UTC

svn commit: r1360041 - in /camel/branches/camel-2.10.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/ components/camel-http/

Author: ningjiang
Date: Wed Jul 11 07:44:09 2012
New Revision: 1360041

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

........
  r1360031 | ningjiang | 2012-07-11 14:31:35 +0800 (Wed, 11 Jul 2012) | 1 line
  
  CAMEL-4014 supports to use Interface as the service class
........

Added:
    camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CamelResourceProvider.java
      - copied unchanged from r1360031, camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CamelResourceProvider.java
    camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SubResourceClassInvocationHandler.java
      - copied unchanged from r1360031, camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SubResourceClassInvocationHandler.java
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
    camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java
    camel/branches/camel-2.10.x/components/camel-http/   (props changed)

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1360031

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul 11 07:44:09 2012
@@ -1 +1 @@
-/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341
+/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341,1360031

Modified: camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java?rev=1360041&r1=1360040&r2=1360041&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java (original)
+++ camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java Wed Jul 11 07:44:09 2012
@@ -140,7 +140,11 @@ public class CxfRsEndpoint extends Defau
             sfb.setAddress(getAddress());
         }
         if (getResourceClasses() != null) {
-            List res = CastUtils.cast(getResourceClasses());
+            List<Class<?>> res = CastUtils.cast(getResourceClasses());
+            // setup the resource providers
+            for(Class<?>clazz : res) {
+            	sfb.setResourceProvider(clazz, new CamelResourceProvider(clazz));
+            }
             sfb.setResourceClasses(res);
         }
         sfb.setStart(false);

Modified: camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java?rev=1360041&r1=1360040&r2=1360041&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java (original)
+++ camel/branches/camel-2.10.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java Wed Jul 11 07:44:09 2012
@@ -22,27 +22,17 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
-/**
- *
- * @version
- */
+
 // START SNIPPET: example
 @Path("/customerservice/")
-public class CustomerServiceResource {
-
-    public CustomerServiceResource() {
-    }
+public interface CustomerServiceResource {
 
     @GET
     @Path("/customers/{id}/")
-    public Customer getCustomer(@PathParam("id") String id) {
-        return null;
-    }
+    public Customer getCustomer(@PathParam("id") String id);
 
     @PUT
     @Path("/customers/")
-    public Response updateCustomer(Customer customer) {
-        return null;
-    }
+    public Response updateCustomer(Customer customer);
 }
 // END SNIPPET: example

Propchange: camel/branches/camel-2.10.x/components/camel-http/
------------------------------------------------------------------------------
  Merged /camel/trunk/components/camel-http:r1360031