Re: Intercept (before and after) routes invocations

2015-03-21 Thread janario
Thanks gsegares_cr, but I was looking for something more global. I've found InterceptStrategy. So I added it to CamelContext.addInterceptStrategy and wrap the target Processor: void process(Exchange exchange) { try { myCustomScope.startCustom(); target.process(); } finally { myCu

Intercept (before and after) routes invocations

2015-03-20 Thread Janario Oliveira
Hi guys, I'm trying to enable a custom cdi scope on all process routes. So I'd like to run some code before and after all routes execution. It could be before/after the route execution or before a bean/process invocation: .bean(myCustomScope, "startCustom") .bean(myBean, "myMethod") .bean(myCus