@Override public void exceptionCaught(Throwable cause) throws Exception { deactivateStream(); callback.onFailure(streamId, cause); }
@Override public void exceptionCaught(Throwable cause) throws Exception { handler.deactivateStream(); callback.onFailure(streamId, cause); }
@Override public void close() { clientFactory.close(); } }
@Override public void receive(TransportClient client, ByteBuffer message, RpcResponseCallback callback) { callback.onSuccess(message); }
@Override void handleFailure(String errorMsg, Throwable cause) { handler.removeFetchRequest(streamChunkId); callback.onFailure(chunkIndex, new IOException(errorMsg, cause)); } };
private void deactivateStream() { if (handler instanceof TransportResponseHandler) { // we only have to do this for TransportResponseHandler as it exposes numOutstandingFetches // (there is no extra cleanup that needs to happen) ((TransportResponseHandler) handler).deactivateStream(); } }
/** * Removes any state associated with the given RPC. * * @param requestId The RPC id returned by {@link #sendRpc(ByteBuffer, RpcResponseCallback)}. */ public void removeRpcRequest(long requestId) { handler.removeRpcRequest(requestId); }
/** * Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning * a new Client. Bootstraps will be executed synchronously, and must run successfully in order * to create a Client. */ public TransportClientFactory createClientFactory(List<TransportClientBootstrap> bootstraps) { return new TransportClientFactory(this, bootstraps); }
@Override public String getID() { return streamHandler.getID(); } };
@Override public void exceptionCaught(Throwable cause) throws Exception { handler.deactivateStream(); callback.onFailure(streamId, cause); }
@Override public void receive(TransportClient client, ByteBuffer message, RpcResponseCallback callback) { callback.onSuccess(message); }
/** * shutdown dictionary client */ @Override public void shutDown() { clientFactory.close(); } }
@Override public void exceptionCaught(Throwable cause) throws Exception { deactivateStream(); callback.onFailure(streamId, cause); }
private void deactivateStream() { if (handler instanceof TransportResponseHandler) { // we only have to do this for TransportResponseHandler as it exposes numOutstandingFetches // (there is no extra cleanup that needs to happen) ((TransportResponseHandler) handler).deactivateStream(); } }
/** * Removes any state associated with the given RPC. * * @param requestId The RPC id returned by {@link #sendRpc(ByteBuffer, RpcResponseCallback)}. */ public void removeRpcRequest(long requestId) { handler.removeRpcRequest(requestId); }
/** * Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning * a new Client. Bootstraps will be executed synchronously, and must run successfully in order * to create a Client. */ public TransportClientFactory createClientFactory(List<TransportClientBootstrap> bootstraps) { return new TransportClientFactory(this, bootstraps); }
@Override public void channelInactive() throws Exception { handler.deactivateStream(); callback.onFailure(streamId, new ClosedChannelException()); }
/** * Removes any state associated with the given RPC. * * @param requestId The RPC id returned by {@link #sendRpc(ByteBuffer, RpcResponseCallback)}. */ public void removeRpcRequest(long requestId) { handler.removeRpcRequest(requestId); }
@Override public void channelInactive() throws Exception { handler.deactivateStream(); callback.onFailure(streamId, new ClosedChannelException()); }