camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unmarshall <unmarsh...@gmail.com>
Subject Re: Proper method of looking up osgi service from camel component
Date Tue, 01 Mar 2011 07:04:30 GMT
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.

Mime
View raw message