Package org.apache.camel.processor

Examples of org.apache.camel.processor.WireTapProcessor


    }

    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        Endpoint endpoint = resolveEndpoint(routeContext);
        return new WireTapProcessor(endpoint, getPattern());
    }
View Full Code Here


        Endpoint endpoint = resolveEndpoint(routeContext);

        // executor service is mandatory for wire tap
        executorService = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "WireTap", this, true);

        WireTapProcessor answer = new WireTapProcessor(endpoint, getPattern(), executorService);

        answer.setCopy(isCopy());
        if (newExchangeProcessorRef != null) {
            newExchangeProcessor = routeContext.lookup(newExchangeProcessorRef, Processor.class);
        }
        if (newExchangeProcessor != null) {
            answer.addNewExchangeProcessor(newExchangeProcessor);
        }
        if (newExchangeExpression != null) {
            answer.setNewExchangeExpression(newExchangeExpression.createExpression(routeContext));
        }
        if (headers != null && !headers.isEmpty()) {
            for (SetHeaderDefinition header : headers) {
                Processor processor = header.createProcessor(routeContext);
                answer.addNewExchangeProcessor(processor);
            }
        }
        if (onPrepareRef != null) {
            onPrepare = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), onPrepareRef, Processor.class);
        }
        if (onPrepare != null) {
            answer.setOnPrepare(onPrepare);
        }

        return answer;
    }
View Full Code Here

        // and wrap in unit of work
        String routeId = routeContext.getRoute().idOrCreate(routeContext.getCamelContext().getNodeIdFactory());
        CamelInternalProcessor internal = new CamelInternalProcessor(target);
        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeId));

        WireTapProcessor answer = new WireTapProcessor(endpoint, internal, getPattern(), threadPool, shutdownThreadPool);
        answer.setCopy(isCopy());
        if (newExchangeProcessorRef != null) {
            newExchangeProcessor = routeContext.mandatoryLookup(newExchangeProcessorRef, Processor.class);
        }
        if (newExchangeProcessor != null) {
            answer.addNewExchangeProcessor(newExchangeProcessor);
        }
        if (newExchangeExpression != null) {
            answer.setNewExchangeExpression(newExchangeExpression.createExpression(routeContext));
        }
        if (headers != null && !headers.isEmpty()) {
            for (SetHeaderDefinition header : headers) {
                Processor processor = createProcessor(routeContext, header);
                answer.addNewExchangeProcessor(processor);
            }
        }
        if (onPrepareRef != null) {
            onPrepare = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), onPrepareRef, Processor.class);
        }
        if (onPrepare != null) {
            answer.setOnPrepare(onPrepare);
        }

        return answer;
    }
View Full Code Here

        executorService = ExecutorServiceHelper.getConfiguredExecutorService(routeContext, "WireTap", this);
        if (executorService == null) {
            executorService = routeContext.getCamelContext().getExecutorServiceStrategy().newDefaultThreadPool(this, "WireTap");
        }
        WireTapProcessor answer = new WireTapProcessor(endpoint, getPattern(), executorService);
        if (isCopy() == null) {
            // should default be true
            answer.setCopy(true);
        } else {
            answer.setCopy(isCopy());
        }

        if (newExchangeProcessorRef != null) {
            newExchangeProcessor = routeContext.lookup(newExchangeProcessorRef, Processor.class);
        }
        answer.setNewExchangeProcessor(newExchangeProcessor);
        if (newExchangeExpression != null) {
            answer.setNewExchangeExpression(newExchangeExpression.createExpression(routeContext));
        }

        return answer;
    }
View Full Code Here

        // and wrap in unit of work
        String routeId = routeContext.getRoute().idOrCreate(routeContext.getCamelContext().getNodeIdFactory());
        CamelInternalProcessor internal = new CamelInternalProcessor(target);
        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeId));

        WireTapProcessor answer = new WireTapProcessor(endpoint, internal, getPattern(), threadPool, shutdownThreadPool);
        answer.setCopy(isCopy());
        if (newExchangeProcessorRef != null) {
            newExchangeProcessor = routeContext.mandatoryLookup(newExchangeProcessorRef, Processor.class);
        }
        if (newExchangeProcessor != null) {
            answer.addNewExchangeProcessor(newExchangeProcessor);
        }
        if (newExchangeExpression != null) {
            answer.setNewExchangeExpression(newExchangeExpression.createExpression(routeContext));
        }
        if (headers != null && !headers.isEmpty()) {
            for (SetHeaderDefinition header : headers) {
                Processor processor = createProcessor(routeContext, header);
                answer.addNewExchangeProcessor(processor);
            }
        }
        if (onPrepareRef != null) {
            onPrepare = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), onPrepareRef, Processor.class);
        }
        if (onPrepare != null) {
            answer.setOnPrepare(onPrepare);
        }

        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.WireTapProcessor

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.