2008/12/2 S. Ali Tokmen <[EMAIL PROTECTED]>: > Hello > > James Strachan a écrit : >> >> Just refer to endpoints called "ref:someName" and it'll look up >> "someName" in the registry (JNDI or Spring etc) >> > > OK, I got it... And how do I "register" with the RefComponent so that it > asks my resolver for resolving names.
Your RegistryComponent would just extend RefComponent. Then to register the RegistryComponent into the CamelContext you'd either call CamelContext.addComponent(name, component) or use the inbuilt discovery mechanism using /META-INF/services as described here... http://activemq.apache.org/camel/writing-components.html >> I guess all I really meant was we could derive from RefComponent so we >> can reuse the sameURI mangling (removing the components scheme and >> then calling some strategy method to allow derived classes to >> transform the logical name to a physical name) then folks can have >> multiple implementations of the strategy method; e.g. RefComponent >> looks up an endpoint in the CamelContext's Registry (JNDI or Spring); >> we could have a JNDIComponent which uses a configured JNDI context >> which could work for LDAP etc. Ditto an OSGi component using the OSGi >> registry etc. >> No biggie though - however its implemented this sounds great :) >> > > Great is good. But I would like to make sure I've done the best possible for > integration with the existing CAMEL infrastructure. I've just modified the RefComponent to make it easier to derive from; just derive and override the lookupEndpoint() method and then you don't have to mess with the URI. Though its not a huge biggie - its a fairly marginal reuse of code :) -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/
