Hi,

You can use Spring web ContextLoaderListener in the Web.xml to load the camel 
context like this.

<web-app>
<!-- tell Spring where it should load the XML file -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:camelContext.xml</param-value>
</context-param>
<!-- spring context listener which loads the XML file -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


….  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: willemjiang





On Thursday, October 11, 2012 at 9:43 PM, Flavio Magacho - M4U wrote:

> Ok raviwithyou, but how do you start the camel context?
> You use a Servlet in a web application?  
>  
>  
>  
> -----Original Message-----
> From: raviwithyou [mailto:bytes2r...@gmail.com]  
> Sent: quarta-feira, 10 de outubro de 2012 03:25
> To: users@camel.apache.org (mailto:users@camel.apache.org)
> Subject: Re: Camel and JBoss
>  
> Hi,
>  
> Yes, we did.
> We created an MBean for managing our configurations and hooked up 
> CamelContext to restart our routes.
>  
> There are many ways as you said, we tried to wire in CamelContext to our 
> MBean as below in our camel-context.xml.
>  
> <camelContext autoStartup="true" id="camel"
> xmlns="http://camel.apache.org/schema/spring";>
> ...</camelContext>
> <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"
> lazy-init="false">
> <property name="beans">
> <map>  
> <entry key="com.my.domainname:name=RoutesMgmtBean"
> value-ref="RoutesMgmtBean"/>
> </map>
> </property>
> </bean>
>  
> <bean id="RoutesMgmtBean" class="com.my.domainname.RunCamelApplication">
> <property name="context" ref="camel"/>
> </bean>
>  
>  
> Hope it helps!!!
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-and-JBoss-tp5720819p5720831.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to