You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by javamonkey79 <ja...@gmail.com> on 2013/05/06 19:09:12 UTC

add bean to registry in custom endpoint?

Can you add a custom bean to the registry in a custom endpoint?

I'd like to be able to add some default beans to the registry in my custom
endpoint, is this possible?

I can see that I can get the camel context from the endpoint, and I can get
the registry from the camel context - but the registry appears to be
immutable.

Thanks!



--
View this message in context: http://camel.465427.n5.nabble.com/add-bean-to-registry-in-custom-endpoint-tp5732085.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: add bean to registry in custom endpoint?

Posted by javamonkey79 <ja...@gmail.com>.
Hmm, would it make sense for the Spring registry to be mutable? I can
definitely see the case for unit testing (as I have submitted:
https://issues.apache.org/jira/browse/CAMEL-6342), however, I'm not sure
about the "live" registry. It seems that non-Spring allows for additional
objects to be added to the registry (JndiRegistry for example). 

Don't some of the standard camel components register beans for their later
use\ease of use - if so, how is that done?



--
View this message in context: http://camel.465427.n5.nabble.com/add-bean-to-registry-in-custom-endpoint-tp5732085p5732423.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: add bean to registry in custom endpoint?

Posted by Claus Ibsen <cl...@gmail.com>.
It depends what kind of registry you use.

eg spring is read-only. But you can use Camel's SimpleRegistry which
is just a Map.


On Mon, May 6, 2013 at 7:09 PM, javamonkey79 <ja...@gmail.com> wrote:
> Can you add a custom bean to the registry in a custom endpoint?
>
> I'd like to be able to add some default beans to the registry in my custom
> endpoint, is this possible?
>
> I can see that I can get the camel context from the endpoint, and I can get
> the registry from the camel context - but the registry appears to be
> immutable.
>
> Thanks!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/add-bean-to-registry-in-custom-endpoint-tp5732085.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: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen