I was planing to submit a patch but deadlines have been insane. Its on my to-do list. :) probably next week or week after.
*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>* On Thu, Nov 21, 2013 at 4:27 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: > Logged ticket to include this in Camel 2.13 > https://issues.apache.org/jira/browse/CAMEL-6989 > > For current Camel versions you can add a custom > org.apache.camel.spi.LifecycleStrategy and use its callbacks for when > routes is added. Then you can likely do some init logic there as well. > > > On Sat, Nov 9, 2013 at 3:11 AM, kraythe . <kray...@gmail.com> wrote: > > The problem is that if we are using a ServletContextListener (jndi or > > simple) the lifecycle methods get called after the routes have been > built. > > This prevents the routes from being able to use object in the registry. > In > > specific, I register some configuration information there. To work around > > this, I subclassed JndiCamelServletContextListener and overrode > > createRegistry and used my subclass in the web.xml. However I shouldnt > have > > to do this. What I propose is a code change to the > > CamelServletContextListener. > > > > There should be the following new methods: > > > > beforeAddRoutes(ServletCamelContext context, R registry) > > afterAddRoutes(ServletCamelContext context, R registry) > > > > They would be triggered in CamelServletContextListener in the appropriate > > places. By then, the registry is already up and able to take > registrations > > so it shoulnt be a big deal. As I understand it Spring gets around this > > problem by reading the xml configuration before the routes are built. > > However spring is off the table of discussion for me. > > > > *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>* > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > Email: cib...@redhat.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen >