Package org.apache.camel

Examples of org.apache.camel.AsyncCallback.done()


            public void operationComplete(ChannelFuture channelFuture) throws Exception {
                LOG.trace("Operation complete {}", channelFuture);
                if (!channelFuture.isSuccess()) {
                    // no success the set the caused exception and signal callback and break
                    exchange.setException(channelFuture.getCause());
                    producerCallback.done(false);
                    return;
                }

                // if we do not expect any reply then signal callback to continue routing
                if (!configuration.isSync()) {
View Full Code Here


                            }
                            NettyHelper.close(channel);
                        }
                    } finally {
                        // signal callback to continue routing
                        producerCallback.done(false);
                    }
                }
            }
        });
View Full Code Here

                }
            }

            // notify callback
            AsyncCallback callback = holder.getCallback();
            callback.done(false);
        }
    }

    protected abstract void handleReplyMessage(String correlationID, Message message);
View Full Code Here

                Header h = (Header) it.next();
                e.getOut().setHeader(h.getName(), h.getValue());
            }
            e.getOut().setHeader(HTTP_RESPONSE_CODE, httpResponse.getStatusLine().getStatusCode());
            AsyncCallback callback = (AsyncCallback) e.removeProperty(AsyncCallback.class.getName());
            callback.done(false);
        }

        public void finalizeContext(HttpContext arg0) {
            // TODO Auto-generated method stub
View Full Code Here

            // close channel in case an exception was thrown
            NettyHelper.close(exceptionEvent.getChannel());

            // signal callback
            callback.done(false);
        }
    }

    @Override
    public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
View Full Code Here

            if (LOG.isDebugEnabled()) {
                LOG.debug("Channel closed but no message received from address: {}", producer.getConfiguration().getAddress());
            }
            exchange.setException(new CamelExchangeException("No response received from remote server: " + producer.getConfiguration().getAddress(), exchange));
            // signal callback
            callback.done(false);
        }
    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent messageEvent) throws Exception {
View Full Code Here

        Message message;
        try {
            message = getResponseMessage(exchange, messageEvent);
        } catch (Exception e) {
            exchange.setException(e);
            callback.done(false);
            return;
        }

        // set the result on either IN or OUT on the original exchange depending on its pattern
        if (ExchangeHelper.isOutCapable(exchange)) {
View Full Code Here

                }
                NettyHelper.close(ctx.getChannel());
            }
        } finally {
            // signal callback
            callback.done(false);
        }
    }

    /**
     * Gets the Camel {@link Message} to use as the message to be set on the current {@link Exchange} when
View Full Code Here

                }
            }

            // notify callback
            AsyncCallback callback = holder.getCallback();
            callback.done(false);
        }
    }

    protected abstract void handleReplyMessage(String correlationID, Message message);
View Full Code Here

                addHeaders(messageExchange.getMessage("out"), exchange.getOut());
                addAttachments(messageExchange.getMessage("out"), exchange.getOut());
            }
            done(messageExchange);
        }
        asyncCallback.done(false);
    }

    public boolean process(Exchange exchange, AsyncCallback asyncCallback) {
        try {
            MessageExchange messageExchange = binding.makeJbiMessageExchange(exchange, getExchangeFactory(), jbiEndpoint.getMep());
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.