Search in sources :

Example 1 with DelegateSyncProcessor

use of org.apache.camel.processor.DelegateSyncProcessor in project camel by apache.

the class ProcessDefinition method createProcessor.

@Override
public Processor createProcessor(RouteContext routeContext) {
    Processor answer = processor;
    if (processor == null) {
        ObjectHelper.notNull(ref, "ref", this);
        answer = routeContext.mandatoryLookup(getRef(), Processor.class);
    }
    // (a Processor must be a Service to be enlisted in JMX)
    if (!(answer instanceof Service)) {
        if (answer instanceof AsyncProcessor) {
            // the processor is async by nature so use the async delegate
            answer = new DelegateAsyncProcessor(answer);
        } else {
            // the processor is sync by nature so use the sync delegate
            answer = new DelegateSyncProcessor(answer);
        }
    }
    return answer;
}
Also used : DelegateSyncProcessor(org.apache.camel.processor.DelegateSyncProcessor) DelegateSyncProcessor(org.apache.camel.processor.DelegateSyncProcessor) DelegateAsyncProcessor(org.apache.camel.processor.DelegateAsyncProcessor) Processor(org.apache.camel.Processor) AsyncProcessor(org.apache.camel.AsyncProcessor) DelegateAsyncProcessor(org.apache.camel.processor.DelegateAsyncProcessor) AsyncProcessor(org.apache.camel.AsyncProcessor) Service(org.apache.camel.Service) DelegateAsyncProcessor(org.apache.camel.processor.DelegateAsyncProcessor)

Aggregations

AsyncProcessor (org.apache.camel.AsyncProcessor)1 Processor (org.apache.camel.Processor)1 Service (org.apache.camel.Service)1 DelegateAsyncProcessor (org.apache.camel.processor.DelegateAsyncProcessor)1 DelegateSyncProcessor (org.apache.camel.processor.DelegateSyncProcessor)1