Refine search
@Override public boolean process(Exchange exchange, AsyncCallback callback) { // invoke ths synchronous method as Spring Transaction does *not* support // using multiple threads to span a transaction try { process(exchange); } catch (Throwable e) { exchange.setException(e); } // notify callback we are done synchronously callback.done(true); return true; }
@Override public void onError(Exception exception) { exchange.setException(exception); callback.done(false); } }
@Override public void onException(Exception ex) { exchange.setException(ex); callback.done(false); }
@Override public void onException(Exception ex) { exchange.setException(ex); callback.done(false); }
@Override public void onError(Throwable throwable) { addData(); exchange.setException(throwable); callback.done(false); }
public boolean process(Exchange exchange, AsyncCallback callback) { // invoke this synchronous method as JTA Transaction does *not* // support using multiple threads to span a transaction try { process(exchange); } catch (Throwable e) { exchange.setException(e); } // notify callback we are done synchronously callback.done(true); return true; }
@Override public void onCanceled() { exchange.setException(new RuntimeCamelException("OData HTTP Request cancelled!")); callback.done(false); } });
@Override public void onCanceled() { exchange.setException(new RuntimeCamelException("OData HTTP Request cancelled!")); callback.done(false); } });
@Override public boolean process(final Exchange exchange, final AsyncCallback callback) { try { executor.submit(new RunCommand(exchange, callback)); } catch (Throwable t) { exchange.setException(t); callback.done(true); return true; } return false; }
protected void doTaskCompleted(Throwable ex) { try { // some kind of other error exchange.setException(new CamelExchangeException("JettyClient failed cause by: " + ex.getMessage(), exchange, ex)); } finally { // make sure to lower the latch done.countDown(); } if (callback != null) { // now invoke callback to indicate we are done async callback.done(false); } }
@Override public boolean process(Exchange exchange, AsyncCallback callback) { try { //In the middle of the broker - InOut doesn't make any sense //so we do in only return processInOnly(exchange, callback); } catch (Throwable e) { // must catch exception to ensure callback is invoked as expected // to let Camel error handling deal with this exchange.setException(e); callback.done(true); return true; } }
@Override public boolean process(Exchange exchange, AsyncCallback callback) { try { //In the middle of the broker - InOut doesn't make any sense //so we do in only return processInOnly(exchange, callback); } catch (Throwable e) { // must catch exception to ensure callback is invoked as expected // to let Camel error handling deal with this exchange.setException(e); callback.done(true); return true; } }
@Override public boolean process(Exchange exchange, AsyncCallback callback) { try { //In the middle of the broker - InOut doesn't make any sense //so we do in only return processInOnly(exchange, callback); } catch (Throwable e) { // must catch exception to ensure callback is invoked as expected // to let Camel error handling deal with this exchange.setException(e); callback.done(true); return true; } }
@Override public boolean process(Exchange exchange, AsyncCallback callback) { try { //In the middle of the broker - InOut doesn't make any sense //so we do in only return processInOnly(exchange, callback); } catch (Throwable e) { // must catch exception to ensure callback is invoked as expected // to let Camel error handling deal with this exchange.setException(e); callback.done(true); return true; } }
@Override public void apply(IgniteFuture<Object> future) { Message in = exchange.getIn(); Message out = exchange.getOut(); MessageHelper.copyHeaders(in, out, true); Object result = null; try { result = future.get(); } catch (Exception e) { exchange.setException(e); callback.done(false); return; } exchange.getOut().setBody(result); callback.done(false); } };
@Override public boolean process(Exchange exchange, AsyncCallback callback) { try { applySecurityPolicy(exchange); } catch (Exception e) { // exception occurred so break out exchange.setException(e); callback.done(true); return true; } return super.process(exchange, callback); }
protected void doTaskCompleted(Throwable ex) { if (ex instanceof TimeoutException) { exchange.setException(new ExchangeTimedOutException(exchange, request.getTimeout())); } else { exchange.setException(new CamelExchangeException("JettyClient failed cause by: " + ex.getMessage(), exchange, ex)); } done.countDown(); if (callback != null) { // now invoke callback to indicate we are done async callback.done(false); } }
@Override public boolean process(Exchange exchange, AsyncCallback callback) { ReactiveStreamsHelper.attachCallback(exchange, (data, error) -> { if (error != null) { data.setException(error); } callback.done(false); }); service.sendCamelExchange(name, exchange); return false; }
@Override public void errorCallback(String channel, PubnubError error) { exchange.setException(new CamelException(error.toString())); callback.done(false); } };
/** * {@link #finish()} should be called only inside a <code>synchronized(lock) { ... }</code> block to prevent * concurrent access to {@link #errors}. */ private void finish() { if (errors != null && !errors.isEmpty()) { if (errors.size() == 1) { final Entry<String, Throwable> en = errors.entrySet().iterator().next(); final String msg = "Delivery to the WebSocket peer " + en.getKey() + " channels has failed"; camelExchange.setException(new CamelExchangeException(msg, camelExchange, en.getValue())); } else { final StringBuilder msg = new StringBuilder( "Delivery to the following WebSocket peer channels has failed: "); for (Entry<String, Throwable> en : errors.entrySet()) { msg.append("\n ").append(en.getKey()).append(en.getValue().getMessage()); } camelExchange.setException(new CamelExchangeException(msg.toString(), camelExchange)); } } camelCallback.done(false); }