Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Chris Wolf
Are you running this code in web container? If so, which? Tomcat, Jetty, JBoss? If you are just running as a standalone Java app, you can just use "SimpleRegistry", which is basically a Map. CamelContext context = new DefaultCamelContext(new SimpleRegistry()); Registry registry

Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Gert Villemos
I meant that I in the RouteBuilder::configure have; JndiRegistry registry = (JndiRegistry) getContext().getRegistry(); // DO NOT WORK! --- Thanks for the suggestion. The code PropertyPlaceholderDelegateRegistry registry = (PropertyPlaceholderDelegateRegistry) getContext().getRegistry()

Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Chris Wolf
It may, or may not be wrapped in PropertyPlaceholderDelegateRegistry, in that case, I would try this: Registry registry = context.getRegistry(); if (registry instanceof PropertyPlaceholderDelegateRegistry) registry = ((PropertyPlaceholderDelegateRegistry)registry).getRe

Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Donald Whytock
On Mon, Mar 18, 2013 at 2:02 PM, Gert Villemos wrote: > Hmmm... tried that but doesnt work. > > getContext() returns a > org.apache.camel.impl.PropertyPlaceholderDelegateRegistry object. Which cant > be cast to JndiRegistry. > > My setup is the following; In a Spring based route I have bean A. Bea

Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Gert Villemos
Hmmm... tried that but doesnt work. getContext() returns a org.apache.camel.impl.PropertyPlaceholderDelegateRegistry object. Which cant be cast to JndiRegistry. My setup is the following; In a Spring based route I have bean A. Bean As @Handler will create an instance of bean B, which is a RouteBu

Re: Programatically adding beans to a registry in a RouteBuilder

2013-03-18 Thread Donald Whytock
On Mon, Mar 18, 2013 at 12:16 PM, Gert Villemos wrote: > How can I in the 'configure' method of a RouteBuilder add beans to the > registry? > > Im in a RouteBuilder creating a route using Netty. The Netty URL reference > encoder/decoder beans. I need to create and insert these beans in the > regis