Package org.apache.camel.model

Examples of org.apache.camel.model.InterceptDefinition


        // get the intercepted processor from the definition
        // we need to use the UoW to have its own index of how far we got into the list
        // of intercepted processors the intercept definition holds as the intercept
        // definition is a single object that is shared by concurrent thread being routed
        // so each exchange has its own private counter
        InterceptDefinition intercept = (InterceptDefinition) node;
        Processor last = intercept.getInterceptedProcessor(tuow.getAndIncrement(intercept));
        if (last != null) {
            tuow.addTraced(new DefaultRouteNode(node, last));

            // log and trace the processor that was intercepted so we can see it
            logExchange(exchange);
View Full Code Here


                // add exception handlers as top children
                route.getOutputs().addAll(exceptionHandlers);
               
                // add the interceptor but we must do some pre configuration beforehand
                intercept.afterPropertiesSet();
                InterceptDefinition proxy = intercept.createProxy();
                route.addOutput(proxy);
                route.pushBlock(proxy.getProceed());

                // if there is a proceed in the interceptor proxy then we should add
                // the current outputs to out route so we will proceed and continue to route to them
                ProceedDefinition proceed = ProcessorTypeHelper.findFirstTypeInOutputs(proxy.getOutputs(), ProceedDefinition.class);
                if (proceed != null) {
                    proceed.getOutputs().addAll(outputs);
                }
            }
View Full Code Here

    }

    @SuppressWarnings("rawtypes")
    @Override
    public ProcessorDefinition createCamelDefinition() {
        InterceptDefinition answer = new InterceptDefinition();

        answer.setInheritErrorHandler(toXmlPropertyValue(PROPERTY_INHERITERRORHANDLER, Objects.<Boolean>getField(this, "inheritErrorHandler")));

        super.savePropertiesToCamelDefinition(answer);
        return answer;
    }
View Full Code Here

    @Override
    protected void loadPropertiesFromCamelDefinition(ProcessorDefinition processor) {
        super.loadPropertiesFromCamelDefinition(processor);

        if (processor instanceof InterceptDefinition) {
            InterceptDefinition node = (InterceptDefinition) processor;

            this.setInheritErrorHandler(Objects.<Boolean>getField(node, "inheritErrorHandler"));
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof InterceptDefinition. Was " + processor.getClass().getName());
        }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.InterceptDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.