Examples of UnitOfWorkProcessor


Examples of org.apache.camel.processor.UnitOfWorkProcessor

            executorService = ExecutorServiceHelper.newScheduledThreadPool(poolSize, "AsyncProcessor", true);
        }
        Processor childProcessor = routeContext.createProcessor(this);

        // wrap it in a unit of work so the route that comes next is also done in a unit of work
        UnitOfWorkProcessor uow = new UnitOfWorkProcessor(childProcessor);

        return new ThreadsProcessor(uow, executorService, waitForTaskToComplete);
    }
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

        // now lets turn all of the event driven consumer processors into a single route
        if (!eventDrivenProcessors.isEmpty()) {
            Processor processor = Pipeline.newInstance(eventDrivenProcessors);

            // and wrap it in a unit of work so the UoW is on the top, so the entire route will be in the same UoW
            Processor unitOfWorkProcessor = new UnitOfWorkProcessor(this, processor);
            Processor target = unitOfWorkProcessor;

            // and then optionally add route policy processor if a custom policy is set
            RoutePolicyProcessor routePolicyProcessor = null;
            RoutePolicy policy = getRoutePolicy();
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

            executorService = ExecutorServiceHelper.newScheduledThreadPool(poolSize, "Threads", true);
        }
        Processor childProcessor = routeContext.createProcessor(this);

        // wrap it in a unit of work so the route that comes next is also done in a unit of work
        UnitOfWorkProcessor uow = new UnitOfWorkProcessor(childProcessor);

        return new ThreadsProcessor(uow, executorService, waitForTaskToComplete);
    }
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

            throw new IllegalArgumentException("Both onCompleteOnly and onFailureOnly cannot be true. Only one of them can be true. On node: " + this);
        }

        Processor childProcessor = this.createChildProcessor(routeContext, true);
        // wrap the on completion route in a unit of work processor
        childProcessor = new UnitOfWorkProcessor(routeContext, childProcessor);

        String id = routeContext.getRoute().getId();
        onCompletions.put(id, childProcessor);

        Predicate when = null;
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

     */
    protected Processor createConsumerProcessor(final Object pojo, final Method method, final Endpoint endpoint) {
        BeanInfo info = new BeanInfo(getCamelContext(), method);
        BeanProcessor answer = new BeanProcessor(pojo, info);
        // must ensure the consumer is being executed in an unit of work so synchronization callbacks etc is invoked
        return new UnitOfWorkProcessor(answer);
    }
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        Processor childProcessor = createOutputsProcessor(routeContext);

        // wrap the on completion route in a unit of work processor
        childProcessor = new UnitOfWorkProcessor(childProcessor);

        Predicate when = null;
        if (onWhen != null) {
            when = onWhen.getExpression().createPredicate(routeContext);
        }
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

        // now lets turn all of the event driven consumer processors into a single route
        if (!eventDrivenProcessors.isEmpty()) {
            Processor processor = Pipeline.newInstance(eventDrivenProcessors);

            // and wrap it in a unit of work so the UoW is on the top, so the entire route will be in the same UoW
            Processor unitOfWorkProcessor = new UnitOfWorkProcessor(processor);
            Processor target = unitOfWorkProcessor;

            // and then optionally add route policy processor if a custom policy is set
            RoutePolicyProcessor routePolicyProcessor = null;
            RoutePolicy policy = getRoutePolicy();
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

        // create the child processor which is the async route
        Processor childProcessor = routeContext.createProcessor(this);

        // wrap it in a unit of work so the route that comes next is also done in a unit of work
        UnitOfWorkProcessor uow = new UnitOfWorkProcessor(childProcessor);

        // create async processor
        Endpoint endpoint = resolveEndpoint(routeContext);

        SendAsyncProcessor async = new SendAsyncProcessor(endpoint, getPattern(), uow);
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

        Endpoint endpoint = resolveEndpoint(routeContext);
        Producer producer = endpoint.createProducer();
        // create error handler we need to use for processing the wire tapped
        Processor target = wrapInErrorHandler(routeContext, producer);
        // and wrap in UoW, which is needed for error handler as well
        target = new UnitOfWorkProcessor(routeContext, target);

        WireTapProcessor answer = new WireTapProcessor(endpoint, target, getPattern(), threadPool, shutdownThreadPool);
        answer.setCopy(isCopy());
        if (newExchangeProcessorRef != null) {
            newExchangeProcessor = routeContext.mandatoryLookup(newExchangeProcessorRef, Processor.class);
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

        // now lets turn all of the event driven consumer processors into a single route
        if (!eventDrivenProcessors.isEmpty()) {
            Processor target = Pipeline.newInstance(getCamelContext(), eventDrivenProcessors);

            // and wrap it in a unit of work so the UoW is on the top, so the entire route will be in the same UoW
            UnitOfWorkProcessor unitOfWorkProcessor = new UnitOfWorkProcessor(this, target);

            // and then optionally add route policy processor if a custom policy is set
            RoutePolicyProcessor routePolicyProcessor = null;
            List<RoutePolicy> routePolicyList = getRoutePolicyList();
            if (routePolicyList != null && !routePolicyList.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.