Package org.apache.camel

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) {
                try {
                    UnitOfWork uow = exchange.getUnitOfWork();
                    // pop the route context we just used
                    if (uow != null) {
View Full Code Here


        while (continueRouting(processors, exchange)) {
            ExchangeHelper.prepareOutToIn(exchange);

            // process the next processor
            AsyncProcessor processor = processors.next();
            boolean sync = process(exchange, callback, processor, processors);

            // continue as long its being processed synchronously
            if (!sync) {
                LOG.trace("Processing exchangeId: {} is continued being processed asynchronously", exchange.getExchangeId());
View Full Code Here

                // continue processing the try .. catch .. finally asynchronously
                while (continueRouting(processors, exchange)) {
                    ExchangeHelper.prepareOutToIn(exchange);

                    // process the next processor
                    AsyncProcessor processor = processors.next();
                    doneSync = process(exchange, callback, processor, processors);

                    if (!doneSync) {
                        LOG.trace("Processing exchangeId: {} is continued being processed asynchronously", exchange.getExchangeId());
                        // the remainder of the try .. catch .. finally will be completed async
View Full Code Here

        if (processor == null) {
            throw new IllegalStateException("No processors could be chosen to process " + copy);
        }
        log.debug("Processing failover at attempt {} for {}", attempts, copy);

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

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

            // let the prepared process it, remember to begin the exchange pair
            AsyncProcessor async = AsyncProcessorConverterHelper.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

                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 = AsyncProcessorConverterHelper.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

            // 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 = AsyncProcessorConverterHelper.convert(processor);
            sync = AsyncProcessorHelper.process(afp, exchange, new AsyncCallback() {
                public void done(boolean sync) {
                    log.trace("Failure processor done: {} processing Exchange: {}", processor, exchange);
                    try {
                        prepareExchangeAfterFailure(exchange, data, shouldHandle, shouldContinue);
View Full Code Here

            // 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) {
                    log.trace("Failure processor done: {} processing Exchange: {}", processor, exchange);
                    try {
                        prepareExchangeAfterFailure(exchange, data);
View Full Code Here

        if (processor == null) {
            throw new IllegalStateException("No processors could be chosen to process " + copy);
        }
        log.debug("Processing failover at attempt {} for {}", attempts, copy);

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

            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

TOP

Related Classes of org.apache.camel.AsyncProcessor

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.