@Override public Processor wrapProcessorInInterceptors(final CamelContext context, final ProcessorDefinition<?> definition, final Processor target, final Processor nextTarget) throws Exception { RouteDefinitionHelper.forceAssignIds(context, definition); return new DelegateAsyncProcessor(target) { @Override public boolean process(final Exchange exchange, final AsyncCallback callback) { LOG.debug("Setting current processor defintion '" + definition.getId() + "'"); exchange.setProperty(CURRENT_PROCESSOR_DEFINITION, definition); return processor.process(exchange, callback); } }; }
private void forceAutoAssigningIds() { for (RouteContext routeContext : routeContexts) { CamelContext camelContext = routeContext.getCamelContext(); NodeIdFactory factory = camelContext.getNodeIdFactory(); if (factory != null) { for (ProcessorDefinition<?> child : processors) { // ensure also the children get ids assigned RouteDefinitionHelper.forceAssignIds(camelContext, child); } } } }
private void forceAutoAssigningIds() { for (RouteContext routeContext : routeContexts) { CamelContext camelContext = routeContext.getCamelContext(); NodeIdFactory factory = camelContext.getNodeIdFactory(); if (factory != null) { for (ProcessorDefinition<?> child : processors) { // ensure also the children get ids assigned RouteDefinitionHelper.forceAssignIds(camelContext, child); } } } }
public Processor wrap(RouteContext routeContext, ProcessorDefinition<?> definition, Processor processor) { if (processor == null) { return null; } // is this the first output from a route, as we want to know this so we can do special logic in first boolean first = false; RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); if (route != null) { if (routeContext.getCamelContext().getNodeIdFactory() != null) { RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), route); } if (!route.getOutputs().isEmpty()) { first = route.getOutputs().get(0) == definition; } } routeContexts.add(routeContext); processors.add(definition); return new TraceProcessor(queue, processor, definition, route, first, this); }
public Processor wrap(RouteContext routeContext, ProcessorDefinition<?> definition, Processor proc) { if (proc == null) { return null; } RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); if (route != null) { if (routeContext.getCamelContext().getNodeIdFactory() != null) { RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), route); } } return new ProfilerProcessor(this, proc, getStats(definition), exchanges); }
public Processor wrap(RouteContext routeContext, ProcessorDefinition<?> definition, Processor processor) { if (processor == null) { return null; } // is this the first output from a route, as we want to know this so we can do special logic in first boolean first = false; RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); if (route != null) { if (routeContext.getCamelContext().getNodeIdFactory() != null) { RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), route); } if (!route.getOutputs().isEmpty()) { first = route.getOutputs().get(0) == definition; } } routeContexts.add(routeContext); processors.add(definition); TraceProcessor traceProcessor = new TraceProcessor(queue, processor, definition, route, first, this); traceProcessor.setCamelContext(routeContext.getCamelContext()); if (processor instanceof CamelContextAware) { ((CamelContextAware) processor).setCamelContext(routeContext.getCamelContext()); } return traceProcessor; }
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; }