Search in sources :

Example 6 with FilterProcessor

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;
}
Also used : CamelContextAware(org.apache.camel.CamelContextAware) RouteDefinition(org.apache.camel.model.RouteDefinition) FilterProcessor(org.apache.camel.processor.FilterProcessor)

Aggregations

FilterProcessor (org.apache.camel.processor.FilterProcessor)6 Processor (org.apache.camel.Processor)3 ChoiceProcessor (org.apache.camel.processor.ChoiceProcessor)3 SendProcessor (org.apache.camel.processor.SendProcessor)3 Channel (org.apache.camel.Channel)2 DelegateProcessor (org.apache.camel.DelegateProcessor)2 Endpoint (org.apache.camel.Endpoint)2 Route (org.apache.camel.Route)2 EventDrivenConsumerRoute (org.apache.camel.impl.EventDrivenConsumerRoute)2 MulticastProcessor (org.apache.camel.processor.MulticastProcessor)2 ThreadsProcessor (org.apache.camel.processor.ThreadsProcessor)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 CompositeData (javax.management.openmbean.CompositeData)1 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)1 CompositeType (javax.management.openmbean.CompositeType)1 TabularData (javax.management.openmbean.TabularData)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1 CamelContextAware (org.apache.camel.CamelContextAware)1 BeanProcessor (org.apache.camel.component.bean.BeanProcessor)1