Author: davsclaus Date: Tue Dec 2 05:15:53 2008 New Revision: 722451 URL: http://svn.apache.org/viewvc?rev=722451&view=rev Log: Merged revisions 722415 via svnmerge from https://svn.apache.org/repos/asf/activemq/camel/trunk
........ r722415 | jstrachan | 2008-12-02 11:36:15 +0100 (ti, 02 dec 2008) | 1 line minor refactor of RefComponent so it can be used as a base class for RegistryComponent. See http://www.nabble.com/Registry-Repository-support-in-CAMEL-td20774062s22882.html ........ Modified: activemq/camel/branches/camel-1.x/ (props changed) activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/component/ref/RefComponent.java Propchange: activemq/camel/branches/camel-1.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Dec 2 05:15:53 2008 @@ -1 +1 @@ -/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662,719848,719851,719855,719864,719978-719979,720207,720435-720437,720806,721272,721331,721333-721334,721360,721669,721764,721813,721985,722005,722070,722110 +/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662,719848,719851,719855,719864,719978-719979,720207,720435-720437,720806,721272,721331,721333-721334,721360,721669,721764,721813,721985,722005,722070,722110,722415 Propchange: activemq/camel/branches/camel-1.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/component/ref/RefComponent.java URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/component/ref/RefComponent.java?rev=722451&r1=722450&r2=722451&view=diff ============================================================================== --- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/component/ref/RefComponent.java (original) +++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/component/ref/RefComponent.java Tue Dec 2 05:15:53 2008 @@ -30,7 +30,23 @@ public class RefComponent extends DefaultComponent<Exchange> { protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { - String name = uri.substring("ref:".length()); + // lets remove the scheme from the URI + int index = uri.indexOf(":"); + String name = uri; + if (index >= 0) { + name = uri.substring(index + 1); + } + return lookupEndpoint(name, parameters); + } + + /** + * Looks up an endpoint for a given name. + * + * Derived classes could use this name as a logical name and look it up on some registry. + * + * The default implementation will look up the name in the registry of the [EMAIL PROTECTED] #getCamelContext()} property + */ + protected Endpoint lookupEndpoint(String name, Map parameters) { return getCamelContext().getRegistry().lookup(name, Endpoint.class); }
