Hi, Willem Jiang:
        I think maybe the feature is not very ease to add; 
        Although we can temporary change the code of OSGIServiceRegistry to
enable osgi service filter. But the solution has such disadvantages:
        1) the bean-name will be ugly , because it contains not only the
service class name , but also the filter express. The format of bean-name is
un-usual; maybe: if we list the filter express in uri parameters, things
will be better; 

        2) camel bean's lifecycle is assumed statically. But OSGI services
is not so; It maybe dynamically, or be-not-ready when camel route started;
So if we still rely on bean-endpoint to invoke OSGI service, things will be
wrong if service is not static;
        I think the correct solution should be : introduce another component
(OSGI Component) to dynamically invoke osgi services; not to just change
Camel's  OSGI-Registry;

-----Original -----
Sender: Willem Jiang [mailto:[email protected]] 
Date: 2010/12/16 20:07
Receiver: [email protected]
Subject: Re: How to setup a dynamic route using beans in Java w/o having a
spring ref to them?

Yes, Current Camel OSGi registry just grab the service from OSGi service 
registry, it doesn't support the filter.

I think this feature is easy to add and please don't hesitate to 
contribute your patch.

On 12/16/10 7:25 PM, ext2 wrote:
> Camel Osgi registry doesn't support filter for services;
>
> You'd better write your own processor to locate osgi services; it's not so
> sophisticated , just do some  reflecting works;
>
> But if you do wish to use camel bean's features, the only way I know is
> change the source code of CamelOsgiRegistry to support osgi service
filter;
> (it's unfortunately) then you can use recipient list to dynamic create a
> endpoint to invoke osgi service;
>
> -----Original-----
> Sender: klausb [mailto:[email protected]]
> Date: 2010/12/16 17:47
> Receiver: [email protected]
> Subject: Re: How to setup a dynamic route using beans in Java w/o having a
> spring ref to them?
>
>
> Hi Sebastian,
>
> thanks for the good explaination. However I do not have a problem with a
> dynamic bean activation as such.
> I was rather asking for a method to avoid the osgi reference tag, because
> the wiring-component, that creates the routes from an external config
should
> not know about the beans in advance. Which is the case, if I have to
> register all the potential beans in the spring file.
>
> klaus


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang


Reply via email to