You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "kraythe ." <kr...@gmail.com> on 2014/02/19 16:37:59 UTC

Spring Registry Question

Greetings,

I am using camel without spring configuration to plug into a JBoss web app
and someone asked me a question I couldn't answer so I was hoping someone
here could. The thing is I needed to have configuration objects bound in
the camel registry BEFORE my route builder came up so I had to subclass the
CamelServletContextListener<JNDIRegistry> and put my additions in the
createRegistry()
method. This is because there is currently no way to plug in a lifecycle
class to invoke before routes are built. I even submitted my altered files
back to this list.

The question is, how would one accomplish binding objects into the camel
registry BEFORE the route are built using a spring file for context
configuration and the org.springframework.web.context.ContextLoaderListener?

Thanks in advance.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*

Re: Spring Registry Question

Posted by Henryk Konsek <he...@gmail.com>.
Hi Rob,

> The question is, how would one accomplish binding objects into the camel
> registry BEFORE the route are built using a spring file for context
> configuration and the org.springframework.web.context.ContextLoaderListener?

Actually I'm surprised that we don't have Spring-aware
CamelServletContextListener implementation. It will be nice to have
SpringCamelServletContextListener extending
CamelServletContextListener and delegating to Spring's
ContextLoaderListener. That would solve your issues. Anybody willing
to contribute [1]? :)

Cheers.

[1] https://camel.apache.org/contributing.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com