Package org.apache.camel

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


        if (producer.getConfiguration().isTextline()) {
            try {
                body = producer.getContext().getTypeConverter().mandatoryConvertTo(String.class, exchange, body);
            } catch (NoTypeConversionAvailableException e) {
                exchange.setException(e);
                callback.done(false);
            }
        }


        // set the result on either IN or OUT on the original exchange depending on its pattern
View Full Code Here


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

    private Exchange getExchange(ChannelHandlerContext ctx) {
        NettyCamelState state = producer.getState(ctx.getChannel());
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

            // 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

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.