You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by unmarshall <un...@gmail.com> on 2011/03/01 08:04:30 UTC

Re: Proper method of looking up osgi service from camel component

Hi Willem,

I am not sure what you mean by wrap the component with java code. Let us say
the client creates a camel route like below:

<c:customComponent id="beanID">
   ...... // all custom configuration elements go here
</c:customComponent>

<camelContext>
   <route>
       <from uri="file:///tmp"/>
       <to uri="c:bean:beanID" />
   </route>
</camelContext>

Now i define <osgi:reference> tags in another beans XML and then ask the
user to just import this when creating a camel route. <import
resource="META-INF/osgi-services.xml"/>

The only way i see the service available is via accessing the application
context and then getting the included the service reference (which the user
has imported) but that is not injection and that will then have coupling
with the Spring classes. 

Did you have anything else in mind?

Best Regards,
Madhav


Willem.Jiang wrote:
> 
> Hi Madhav,
> 
> If you don't want your client to know about how to inject the osgi 
> services, it's a best way to wrap the component with Java code.
> 
> Willem
> 
> 


-- 
View this message in context: http://camel.465427.n5.nabble.com/Proper-method-of-looking-up-osgi-service-from-camel-component-tp3402863p3404483.html
Sent from the Camel - Users mailing list archive at Nabble.com.