Examples of addOnCompletion()


Examples of org.apache.camel.Exchange.addOnCompletion()

            // must use the original message in case we need to workaround a charset issue when extracting mail content
            final Message mail = exchange.getIn(MailMessage.class).getOriginalMessage();

            // add on completion to handle after work when the exchange is done
            exchange.addOnCompletion(new Synchronization() {
                public void onComplete(Exchange exchange) {
                    processCommit(mail, exchange);
                }

                public void onFailure(Exchange exchange) {
View Full Code Here

Examples of org.apache.camel.Exchange.addOnCompletion()

            // latch that waits until we are complete
            final CountDownLatch latch = new CountDownLatch(1);

            // we should wait for the reply so install a on completion so we know when its complete
            copy.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange response) {
                    // check for timeout, which then already would have invoked the latch
                    if (latch.getCount() == 0) {
                        if (log.isTraceEnabled()) {
View Full Code Here

Examples of org.apache.camel.Exchange.addOnCompletion()

            // update pending number of exchanges
            pendingExchanges = total - index - 1;

            // add on completion to handle after work when the exchange is done
            exchange.addOnCompletion(new Synchronization() {
                public void onComplete(Exchange exchange) {
                    processCommit(exchange);
                }

                public void onFailure(Exchange exchange) {
View Full Code Here

Examples of org.apache.camel.Exchange.addOnCompletion()

            // update pending number of exchanges
            pendingExchanges = total - index - 1;

            // add on completion to handle after work when the exchange is done
            exchange.addOnCompletion(new Synchronization() {
                public void onComplete(Exchange exchange) {
                    processCommit(exchange);
                }

                public void onFailure(Exchange exchange) {
View Full Code Here

Examples of org.apache.camel.Exchange.addOnCompletion()

            // latch that waits until we are complete
            final CountDownLatch latch = new CountDownLatch(1);

            // we should wait for the reply so install a on completion so we know when its complete
            copy.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange response) {
                    // check for timeout, which then already would have invoked the latch
                    if (latch.getCount() == 0) {
                        if (log.isTraceEnabled()) {
View Full Code Here

Examples of org.apache.camel.Exchange.addOnCompletion()

            // latch that waits until we are complete
            final CountDownLatch latch = new CountDownLatch(1);

            // we should wait for the reply so install a on completion so we know when its complete
            copy.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange response) {
                    // check for timeout, which then already would have invoked the latch
                    if (latch.getCount() == 0) {
                        if (log.isTraceEnabled()) {
View Full Code Here

Examples of org.apache.camel.impl.DefaultExchange.addOnCompletion()

            final DefaultExchange exchange = (DefaultExchange) SjmsExchangeMessageHelper.createExchange(message, getEndpoint());

            log.debug("Processing Exchange.id:{}", exchange.getExchangeId());

            if (isTransacted() && synchronization != null) {
                exchange.addOnCompletion(synchronization);
            }
            try {
                if (isTransacted() || isSynchronous()) {
                    log.debug("  Handling synchronous message: {}", exchange.getIn().getBody());
                    handleMessage(exchange);
View Full Code Here

Examples of org.apache.camel.impl.DefaultExchange.addOnCompletion()

            final DefaultExchange exchange = (DefaultExchange)SjmsExchangeMessageHelper.createExchange(message, getEndpoint());
           
            log.debug("Processing Exchange.id:{}", exchange.getExchangeId());
           
            if (isTransacted() && synchronization != null) {
                exchange.addOnCompletion(synchronization);
            }
            try {
                if (isTransacted() || isSynchronous()) {
                    log.debug("  Handling synchronous message: {}", exchange.getIn().getBody());
                    handleMessage(exchange);
View Full Code Here

Examples of org.apache.camel.impl.DefaultExchange.addOnCompletion()

        public void start() throws Exception {
            consumerThread = Thread.currentThread().getName();

            Exchange exchange = new DefaultExchange(context);
            exchange.setProperty(Exchange.UNIT_OF_WORK_PROCESS_SYNC, true);
            exchange.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange exchange) {
                    doneThread = Thread.currentThread().getName();
                }
            });
View Full Code Here

Examples of org.apache.camel.impl.DefaultExchange.addOnCompletion()

        public void start() throws Exception {
            consumerThread = Thread.currentThread().getName();

            Exchange exchange = new DefaultExchange(context);
            exchange.setProperty(Exchange.UNIT_OF_WORK_PROCESS_SYNC, true);
            exchange.addOnCompletion(new SynchronizationAdapter() {
                @Override
                public void onDone(Exchange exchange) {
                    doneThread = Thread.currentThread().getName();
                }
            });
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.