use of org.apache.camel.processor.FilterProcessor in project fabric8 by jboss-fuse.
the class Profiler method wrap.
public Processor wrap(RouteContext routeContext, ProcessorDefinition<?> definition, Processor processor) {
if (processor == null) {
return null;
}
if (processor instanceof FilterProcessor) {
return processor;
}
RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition);
if (route != null) {
if (routeContext.getCamelContext().getNodeIdFactory() != null) {
RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), route);
}
}
ProfilerProcessor profilerProcessor = new ProfilerProcessor(this, processor, getStats(definition), exchanges);
profilerProcessor.setCamelContext(routeContext.getCamelContext());
if (processor instanceof CamelContextAware) {
((CamelContextAware) processor).setCamelContext(routeContext.getCamelContext());
}
return profilerProcessor;
}
Aggregations