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;
}
Aggregations