@Override public void handleError(Throwable error) { callback.handleError(error); } }
/** * Sets an error thrown during RPC execution, and unblocks all threads waiting * on {@link #get()} or {@link #get(long, TimeUnit)}. * @param error the RPC error to set. */ @Override public void handleError(Throwable error) { this.error = error; latch.countDown(); if (chainedCallback != null) { chainedCallback.handleError(error); } }
@Override public void onError(Throwable t) { callback.handleError(new AvroRuntimeException(t)); }
@Override public void onNext(Object value) { if (value instanceof Throwable) { callback.handleError((Throwable) value); } else { callback.handleResult((T) value); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess() && (callback != null)) { callback.handleError( new IOException("Error writing buffers", future.getCause())); } } }
/** * Called by {@link Requestor#request(String,Object,Callback)} for two-way messages using callbacks. */ public void transceive(List<ByteBuffer> request, Callback<List<ByteBuffer>> callback) throws IOException { // The default implementation works synchronously try { List<ByteBuffer> response = transceive(request); callback.handleResult(response); } catch (IOException e) { callback.handleError(e); } }
LOG.debug("Removing " + requestsToCancel.size() + " pending request(s)."); for (Callback<List<ByteBuffer>> request : requestsToCancel.values()) { request.handleError( cause != null ? cause : new IOException(getClass().getSimpleName() + " closed"));
} catch (Exception e) { if (callback != null) { callback.handleError(e);
@Override public void handleError(Throwable error) { callback.handleError(error); } }
/** * Sets an error thrown during RPC execution, and unblocks all threads waiting * on {@link #get()} or {@link #get(long, TimeUnit)}. * @param error the RPC error to set. */ @Override public void handleError(Throwable error) { this.error = error; latch.countDown(); if (chainedCallback != null) { chainedCallback.handleError(error); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess() && (callback != null)) { callback.handleError( new IOException("Error writing buffers", future.getCause())); } } }
/** * Called by {@link Requestor#request(String,Object,Callback)} for two-way messages using callbacks. */ public void transceive(List<ByteBuffer> request, Callback<List<ByteBuffer>> callback) throws IOException { // The default implementation works synchronously try { List<ByteBuffer> response = transceive(request); callback.handleResult(response); } catch (IOException e) { callback.handleError(e); } }
LOG.debug("Removing " + requestsToCancel.size() + " pending request(s)."); for (Callback<List<ByteBuffer>> request : requestsToCancel.values()) { request.handleError( cause != null ? cause : new IOException(getClass().getSimpleName() + " closed"));
} catch (Exception e) { if (callback != null) { callback.handleError(e);