Examples of AsyncProcessor


Examples of org.apache.camel.AsyncProcessor

        }
        Processor processor = chooseProcessor(list, exchange);
        if (processor == null) {
            throw new IllegalStateException("No processors could be chosen to process " + exchange);
        } else {
            AsyncProcessor albp = AsyncProcessorTypeConverter.convert(processor);
            sync = AsyncProcessorHelper.process(albp, exchange, new AsyncCallback() {
                public void done(boolean doneSync) {
                    // only handle the async case
                    if (doneSync) {
                        return;
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

            if (traced != null) {
                traced.pushBlock();
            }

            // let the prepared process it, remember to begin the exchange pair
            AsyncProcessor async = AsyncProcessorTypeConverter.convert(processor);
            pair.begin();
            sync = AsyncProcessorHelper.process(async, exchange, new AsyncCallback() {
                public void done(boolean doneSync) {
                    // we are done with the exchange pair
                    pair.done();
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

                traced.pushBlock();
            }

            // let the prepared process it, remember to begin the exchange pair
            // we invoke it synchronously as parallel async routing is too hard
            AsyncProcessor async = AsyncProcessorTypeConverter.convert(processor);
            pair.begin();
            AsyncProcessorHelper.process(async, exchange);
        } finally {
            pair.done();
            // pop the block so by next round we have the same staring point and thus the tracing looks accurate
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

            watch = new StopWatch();
        }

        try {
            // invoke the callback
            AsyncProcessor asyncProcessor = AsyncProcessorTypeConverter.convert(producer);
            sync = producerCallback.doInAsyncProducer(producer, asyncProcessor, exchange, pattern, callback);
        } catch (Throwable e) {
            // ensure exceptions is caught and set on the exchange
            if (exchange != null) {
                exchange.setException(e);
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

            }

            // get the next processor
            Processor processor = processors.next();

            AsyncProcessor async = AsyncProcessorTypeConverter.convert(processor);
            boolean sync = process(exchange, nextExchange, callback, processors, async);

            // continue as long its being processed synchronously
            if (!sync) {
                if (LOG.isTraceEnabled()) {
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

                }

                // continue processing the pipeline asynchronously
                Exchange nextExchange = exchange;
                while (continueRouting(processors, nextExchange)) {
                    AsyncProcessor processor = AsyncProcessorTypeConverter.convert(processors.next());

                    // check for error if so we should break out
                    boolean exceptionHandled = hasExceptionBeenHandledByErrorHandler(nextExchange);
                    if (nextExchange.isFailed() || nextExchange.isRollbackOnly() || exceptionHandled) {
                        // The Exchange.ERRORHANDLED_HANDLED property is only set if satisfactory handling was done
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

            // store the last to endpoint as the failure endpoint
            exchange.setProperty(Exchange.FAILURE_ENDPOINT, exchange.getProperty(Exchange.TO_ENDPOINT));

            // the failure processor could also be asynchronous
            AsyncProcessor afp = AsyncProcessorTypeConverter.convert(processor);
            sync = AsyncProcessorHelper.process(afp, exchange, new AsyncCallback() {
                public void done(boolean sync) {
                    if (log.isTraceEnabled()) {
                        log.trace("Failure processor done: " + processor + " processing Exchange: " + exchange);
                    }
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

        // push the current route context
        if (exchange.getUnitOfWork() != null) {
            exchange.getUnitOfWork().pushRouteContext(routeContext);
        }

        AsyncProcessor async = AsyncProcessorTypeConverter.convert(processor);
        boolean sync = async.process(exchange, new AsyncCallback() {
            public void done(boolean doneSync) {
                // pop the route context we just used
                if (exchange.getUnitOfWork() != null) {
                    exchange.getUnitOfWork().popRouteContext();
                }
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

        }
        if (log.isDebugEnabled()) {
            log.debug("Processing failover at attempt " + attempts + " for " + exchange);
        }

        AsyncProcessor albp = AsyncProcessorTypeConverter.convert(processor);
        return AsyncProcessorHelper.process(albp, exchange, new FailOverAsyncCallback(exchange, attempts, index, callback, processors));
    }
View Full Code Here

Examples of org.apache.camel.AsyncProcessor

            watch = new StopWatch();
        }

        try {
            // invoke the callback
            AsyncProcessor asyncProcessor = AsyncProcessorTypeConverter.convert(producer);
            sync = producerCallback.doInAsyncProducer(producer, asyncProcessor, exchange, pattern, callback);
        } catch (Throwable e) {
            // ensure exceptions is caught and set on the exchange
            if (exchange != null) {
                exchange.setException(e);
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.