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/08/24 14:54:52 UTC

svn commit: r1376899 - in /camel/branches/camel-2.9.x: ./ components/camel-restlet/src/main/java/org/apache/camel/component/restlet/ components/camel-restlet/src/test/java/org/apache/camel/component/restlet/

Author: ningjiang
Date: Fri Aug 24 12:54:51 2012
New Revision: 1376899

URL: http://svn.apache.org/viewvc?rev=1376899&view=rev
Log:
Merged revisions 1376895 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x

................
  r1376895 | ningjiang | 2012-08-24 20:41:04 +0800 (Fri, 24 Aug 2012) | 9 lines
  
  Merged revisions 1376870 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1376870 | ningjiang | 2012-08-24 17:10:40 +0800 (Fri, 24 Aug 2012) | 1 line
    
    CAMEL-5535 update endpoint uri to support multiple restlet routes of the same restlet URI but different VERBs
  ........
................

Added:
    camel/branches/camel-2.9.x/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletMultiRoutesEndpointTest.java
      - copied unchanged from r1376895, camel/branches/camel-2.10.x/components/camel-restlet/src/test/java/org/apache/camel/component/restlet/RestletMultiRoutesEndpointTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
    camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1376870
  Merged /camel/branches/camel-2.10.x:r1376895

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java?rev=1376899&r1=1376898&r2=1376899&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java (original)
+++ camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java Fri Aug 24 12:54:51 2012
@@ -82,6 +82,8 @@ public class RestletComponent extends He
         RestletEndpoint result = new RestletEndpoint(this, remaining);
         setEndpointHeaderFilterStrategy(result);
         setProperties(result, parameters);
+        // set the endpoint uri according to the parameter
+        result.updateEndpointUri();
 
         // construct URI so we can use it to get the splitted information
         URI u = new URI(remaining);

Modified: camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java?rev=1376899&r1=1376898&r2=1376899&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java (original)
+++ camel/branches/camel-2.9.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletEndpoint.java Fri Aug 24 12:54:51 2012
@@ -185,6 +185,24 @@ public class RestletEndpoint extends Def
     public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure) {
         this.throwExceptionOnFailure = throwExceptionOnFailure;
     }
+    
+    // Update the endpointUri with the restlet method information
+    protected void updateEndpointUri() {
+        String endpointUri = getEndpointUri();
+        StringBuffer methods = new StringBuffer();
+        if (getRestletMethods() != null && getRestletMethods().length > 0) {
+            for (Method method : getRestletMethods()) {
+                methods = methods.append(method.getName()).append(',');
+            }
+        } else {
+            Method method = getRestletMethod();
+            methods = methods.append(method.getName());
+        }
+        if (methods != null) {
+            endpointUri = endpointUri + "?restletMethods=" + methods.toString();
+            setEndpointUri(endpointUri);
+        }
+    }
 
     @Override
     protected void doStart() throws Exception {