Search in sources :

Example 6 with BeanProcessor

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;
}
Also used : CamelInternalProcessor(org.apache.camel.processor.CamelInternalProcessor) BeanInfo(org.apache.camel.component.bean.BeanInfo) BeanProcessor(org.apache.camel.component.bean.BeanProcessor)

Aggregations

BeanProcessor (org.apache.camel.component.bean.BeanProcessor)6 Endpoint (org.apache.camel.Endpoint)2 FailedToCreateConsumerException (org.apache.camel.FailedToCreateConsumerException)2 BeanInfo (org.apache.camel.component.bean.BeanInfo)2 Iterator (java.util.Iterator)1 CreationException (javax.enterprise.inject.CreationException)1 UnsatisfiedResolutionException (javax.enterprise.inject.UnsatisfiedResolutionException)1 CamelContext (org.apache.camel.CamelContext)1 Consumer (org.apache.camel.Consumer)1 DelegateProcessor (org.apache.camel.DelegateProcessor)1 Processor (org.apache.camel.Processor)1 BeanHolder (org.apache.camel.component.bean.BeanHolder)1 ConstantBeanHolder (org.apache.camel.component.bean.ConstantBeanHolder)1 ConstantStaticTypeBeanHolder (org.apache.camel.component.bean.ConstantStaticTypeBeanHolder)1 ConstantTypeBeanHolder (org.apache.camel.component.bean.ConstantTypeBeanHolder)1 MethodNotFoundException (org.apache.camel.component.bean.MethodNotFoundException)1 RegistryBean (org.apache.camel.component.bean.RegistryBean)1 LogEndpoint (org.apache.camel.component.log.LogEndpoint)1 ManagedAggregateProcessor (org.apache.camel.management.mbean.ManagedAggregateProcessor)1 ManagedBeanProcessor (org.apache.camel.management.mbean.ManagedBeanProcessor)1