Java 类org.apache.camel.model.InterceptDefinition 实例源码

项目:Camel    文件:TraceInterceptor.java   
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);
        }
    }
}
项目:Camel    文件:DefaultManagementLifecycleStrategy.java   
/**
 * 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);
}
项目:Camel    文件:RouteBuilder.java   
/**
 * 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();
}
项目:Camel    文件:CamelContextFactoryBean.java   
public List<InterceptDefinition> getIntercepts() {
    return intercepts;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setIntercepts(List<InterceptDefinition> intercepts) {
    this.intercepts = intercepts;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public List<InterceptDefinition> getIntercepts() {
    return intercepts;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setIntercepts(List<InterceptDefinition> intercepts) {
    this.intercepts = intercepts;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public List<InterceptDefinition> getIntercepts() {
    return intercepts;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setIntercepts(List<InterceptDefinition> intercepts) {
    this.intercepts = intercepts;
}
项目:Camel    文件:CamelGroovyMethods.java   
public static InterceptDefinition when(InterceptDefinition self, Closure<?> predicate) {
    return self.when(toExpression(predicate));
}
项目:switchyard    文件:CamelContextFactoryBeanDelegate.java   
@Override
public List<InterceptDefinition> getIntercepts() {
    return _factoryBean.getIntercepts();
}
项目:camel-cdi    文件:CamelContextFactoryBean.java   
public List<InterceptDefinition> getIntercepts() {
    return intercepts;
}
项目:camel-cdi    文件:CamelContextFactoryBean.java   
public void setIntercepts(List<InterceptDefinition> intercepts) {
    this.intercepts = intercepts;
}
项目:Camel    文件:AbstractCamelContextFactoryBean.java   
public abstract List<InterceptDefinition> getIntercepts();