java - How could I apply custom LifecycleStrategySupport to camel context -


could please provide simplest examples how apply custom lifecyclestrategysupport to
1. camel xml context
2. java camel context

to more exact need have several camel contexts (within single spring context), , apply custom lifecycle strategy 1 of them.

it's easy setup custom lifecyclestrategysupport camel context below code.

    mylifecyclestrategy dummy1 = new mylifecyclestrategy();     camelcontext context = new defaultcamelcontext();     context.addlifecyclestrategy(dummy1); 

if use spring configuration, lifecyclestrategy defined in application inject camelcontext directly. may need check camelcontext id in custom lifecyclestrategy before handling lifecycle event.

<bean id="lifecyclestrategy" class="org.apache.camel.spring.dummylifecyclestrategy"/>  <camelcontext id="camel1" xmlns="http://camel.apache.org/schema/spring"> <route>   <from uri="direct:start"/>   <to uri="mock:result"/> </route> 


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -