use of org.apache.camel.component.bean.BeanProcessor in project camel by apache.
the class CamelPostProcessorHelper method createConsumerProcessor.
/**
* Create a processor which invokes the given method when an incoming
* message exchange is received
*/
protected Processor createConsumerProcessor(final Object pojo, final Method method, final Endpoint endpoint) {
BeanInfo info = new BeanInfo(getCamelContext(), method);
BeanProcessor answer = new BeanProcessor(pojo, info);
// must ensure the consumer is being executed in an unit of work so synchronization callbacks etc is invoked
CamelInternalProcessor internal = new CamelInternalProcessor(answer);
internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(null));
return internal;
}
Aggregations