Examples of UnitOfWorkProcessor


Examples of org.apache.camel.processor.UnitOfWorkProcessor

    }

    protected AggregateProcessor createAggregator(RouteContext routeContext) throws Exception {
        Processor processor = this.createChildProcessor(routeContext, true);
        // wrap the aggregated route in a unit of work processor
        processor = new UnitOfWorkProcessor(routeContext, processor);

        Expression correlation = getExpression().createExpression(routeContext);
        AggregationStrategy strategy = createAggregationStrategy(routeContext);

        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, this, isParallelProcessing());
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

    @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);

            // and create the route that wraps the UoW
            Route edcr = new EventDrivenConsumerRoute(getEndpoint(), unitOfWorkProcessor);
            edcr.getProperties().put(Route.ID_PROPERTY, route.idOrCreate(getCamelContext().getNodeIdFactory()));
            edcr.getProperties().put(Route.PARENT_PROPERTY, Integer.toHexString(route.hashCode()));
View Full Code Here

Examples of org.apache.camel.processor.UnitOfWorkProcessor

    }

    protected AggregateProcessor createAggregator(RouteContext routeContext) throws Exception {
        Processor processor = this.createChildProcessor(routeContext, true);
        // wrap the aggregated route in a unit of work processor
        processor = new UnitOfWorkProcessor(routeContext, processor);

        Expression correlation = getExpression().createExpression(routeContext);
        AggregationStrategy strategy = createAggregationStrategy(routeContext);

        executorService = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Aggregator", this);
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(routeContext, 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

            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(routeContext, childProcessor);

        return new ThreadsProcessor(uow, executorService, waitForTaskToComplete);
    }
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(routeContext, 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(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, 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

     */
    protected Processor createConsumerProcessor(final Object pojo, final Method method, final Endpoint endpoint) {
        BeanProcessor answer = new BeanProcessor(pojo, getCamelContext());
        answer.setMethodObject(method);
        // 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
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.