protected void traceIntercept(InterceptDefinition intercept, TracedRouteNodes traced, Exchange exchange) throws Exception { // use the counter to get the index of the intercepted processor to be traced Processor last = intercept.getInterceptedProcessor(traced.getAndIncrementCounter(intercept)); // skip doing any double tracing of interceptors, so the last must not be a TraceInterceptor instance if (last != null && !(last instanceof TraceInterceptor)) { traced.addTraced(new DefaultRouteNode(node, last)); boolean shouldLog = shouldLogNode(node) && shouldLogExchange(exchange); if (shouldLog) { // log and trace the processor that was intercepted so we can see it logExchange(exchange); traceExchange(exchange); } } }
/** * Should the given processor be registered. */ protected boolean registerProcessor(ProcessorDefinition<?> processor) { // skip on exception if (processor instanceof OnExceptionDefinition) { return false; } // skip on completion if (processor instanceof OnCompletionDefinition) { return false; } // skip intercept if (processor instanceof InterceptDefinition) { return false; } // skip aop if (processor instanceof AOPDefinition) { return false; } // skip policy if (processor instanceof PolicyDefinition) { return false; } // only if custom id assigned boolean only = getManagementStrategy().getManagementAgent().getOnlyRegisterProcessorWithCustomId() != null && getManagementStrategy().getManagementAgent().getOnlyRegisterProcessorWithCustomId(); if (only) { return processor.hasCustomIdAssigned(); } // use customer filter return getManagementStrategy().manageProcessor(processor); }
/** * Adds a route for an interceptor that intercepts every processing step. * * @return the builder */ public InterceptDefinition intercept() { if (!getRouteCollection().getRoutes().isEmpty()) { throw new IllegalArgumentException("intercept must be defined before any routes in the RouteBuilder"); } getRouteCollection().setCamelContext(getContext()); return getRouteCollection().intercept(); }
public List<InterceptDefinition> getIntercepts() { return intercepts; }
public void setIntercepts(List<InterceptDefinition> intercepts) { this.intercepts = intercepts; }
public static InterceptDefinition when(InterceptDefinition self, Closure<?> predicate) { return self.when(toExpression(predicate)); }
@Override public List<InterceptDefinition> getIntercepts() { return _factoryBean.getIntercepts(); }
public abstract List<InterceptDefinition> getIntercepts();