On Tue, Mar 12, 2013 at 10:26 AM, helander <leh...@gmail.com> wrote:
> Fom Java code I would like to register beans in the context registry. I need
> to do this in code that will deployed in various containers (Spring, JEE web
> applications).
> Is there some method that works in all these environments (hiding from my
> code the current registry implementation) or do I have to explicitly test
> the registry class in order to invoke class specific registration methods ?
>
> Thanks
>
> Lars
>

No as the actual registry can be anything, and some is read-only.
So you would need to cater for that, and eg if its a spring registry
(spring app context) then its read-only.

But if you use Jndi registry, then you can often use the bind
operation to add new beans to it etc.
If you are allowed to do so (as it may be secured).

Though if you need a local registry that only Camel needs to be able
to use, you can wrap the current registry using the composite registry
and add a simple registry as well.

And then you can use the SimpleRegistry to add/remove your beans from
your Java code.



>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Register-beans-tp5728978.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to