I don’t think you need to dependency injection in your XML DSL, as we just look 
up the instance from the registry. Can you give an example that you need to use 
Guice to do the DI work?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 13, 2014 at 9:45:32 PM, yogu13 (yogesh....@synechron.com) wrote:
> Here is my understanding of things that needs to be done if Guice - Camel and
> XML DSL have to work together
>  
> 1. create a ServletContextListener which would do the following
> a. extracts Routes from the XML
> b. create a JNDI Registry instance (GuiceyFruit implementation)
> c. pass in the routes to create the injector as below
> Injector injector = Guice.createInjector(new
> CamelModuleWithRouteTypes(Set<>));
> d. create a CamelContext
> CamelContext camelContext = injector.getInstance(CamelContext.class);
> e. set the context in servletcontext which can be looked up and used later
>  
> 2. use existing servlet module as an entry point for triggering rest:// and
> servlet:// endpoints
>  
>  
> Let me know if my understanding is correct here..
>  
> Appreciate the help!
>  
> Regards,
> -Yogesh
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/configuring-Camel-with-XML-DSL-and-Guice-in-tomcat-tp5760657.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  

Reply via email to