private void sendLocalRequest(long requestId, final String action, final TransportRequest request, TransportRequestOptions options) { final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, this, threadPool); try { onRequestSent(localNode, requestId, action, request, options); channel.sendResponse(e); } catch (Exception inner) { inner.addSuppressed(e);
@Override public void sendResponse(Exception exception) throws IOException { service.onResponseSent(requestId, action, exception); final TransportResponseHandler handler = service.responseHandlers.onResponseReceived(requestId, service); // ignore if its null, the service logs it if (handler != null) { final RemoteTransportException rtx = wrapInRemote(exception); final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processException(handler, rtx); } else { threadPool.executor(handler.executor()).execute(new Runnable() { @Override public void run() { processException(handler, rtx); } @Override public String toString() { return "delivery of failure response to [" + requestId + "][" + action + "]: " + exception; } }); } } }
@Override public void sendResponse(TransportResponse response) throws IOException { service.onResponseSent(requestId, action, response); final TransportResponseHandler handler = service.responseHandlers.onResponseReceived(requestId, service); // ignore if its null, the service logs it if (handler != null) { final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processResponse(handler, response); } else { threadPool.executor(executor).execute(new Runnable() { @Override public void run() { processResponse(handler, response); } @Override public String toString() { return "delivery of response to [" + requestId + "][" + action + "]: " + response; } }); } } }
sendResponse(response, TransportResponseOptions.EMPTY); final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processResponse(handler, response); } else { threadPool.executor(executor).execute(() -> processResponse(handler, response));
private void sendLocalRequest(long requestId, final String action, final TransportRequest request, TransportRequestOptions options) { final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, this, threadPool); try { onRequestSent(localNode, requestId, action, request, options);
private void sendLocalRequest(long requestId, final String action, final TransportRequest request, TransportRequestOptions options) { final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, adapter, threadPool); try { adapter.onRequestSent(localNode, requestId, action, request, options); channel.sendResponse(e); } catch (Exception inner) { inner.addSuppressed(e);
private void sendLocalRequest(long requestId, final String action, final TransportRequest request, TransportRequestOptions options) { final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, this, threadPool); try { onRequestSent(localNode, requestId, action, request, options); channel.sendResponse(e); } catch (Exception inner) { inner.addSuppressed(e);
private void sendLocalRequest(long requestId, final String action, final TransportRequest request) { final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, adapter, threadPool); try { final RequestHandlerRegistry reg = adapter.getRequestHandler(action); channel.sendResponse(e); } catch (Throwable e1) { logger.warn("failed to notify channel of error message for action [" + action + "]", e1);
@Override public void sendResponse(Exception exception) throws IOException { service.onResponseSent(requestId, action, exception); final TransportResponseHandler handler = service.responseHandlers.onResponseReceived(requestId, service); // ignore if its null, the service logs it if (handler != null) { final RemoteTransportException rtx = wrapInRemote(exception); final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processException(handler, rtx); } else { threadPool.executor(handler.executor()).execute(new Runnable() { @Override public void run() { processException(handler, rtx); } @Override public String toString() { return "delivery of failure response to [" + requestId + "][" + action + "]: " + exception; } }); } } }
@Override public void sendResponse(final TransportResponse response, TransportResponseOptions options) throws IOException { service.onResponseSent(requestId, action, response, options); final TransportResponseHandler handler = service.responseHandlers.onResponseReceived(requestId, service); // ignore if its null, the service logs it if (handler != null) { final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processResponse(handler, response); } else { threadPool.executor(executor).execute(new Runnable() { @Override public void run() { processResponse(handler, response); } @Override public String toString() { return "delivery of response to [" + requestId + "][" + action + "]: " + response; } }); } } }
@Override public void sendResponse(Exception exception) throws IOException { adapter.onResponseSent(requestId, action, exception); final TransportResponseHandler handler = adapter.onResponseReceived(requestId); // ignore if its null, the adapter logs it if (handler != null) { final RemoteTransportException rtx = wrapInRemote(exception); final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processException(handler, rtx); } else { threadPool.executor(handler.executor()).execute(new Runnable() { @SuppressWarnings({"unchecked"}) @Override public void run() { processException(handler, rtx); } }); } } }
@Override public void sendResponse(Throwable error) throws IOException { final TransportResponseHandler handler = adapter.onResponseReceived(requestId); // ignore if its null, the adapter logs it if (handler != null) { final RemoteTransportException rtx = wrapInRemote(error); final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processException(handler, rtx); } else { threadPool.executor(handler.executor()).execute(new Runnable() { @SuppressWarnings({"unchecked"}) @Override public void run() { processException(handler, rtx); } }); } } }
@Override public void sendResponse(final TransportResponse response, TransportResponseOptions options) throws IOException { final TransportResponseHandler handler = adapter.onResponseReceived(requestId); // ignore if its null, the adapter logs it if (handler != null) { final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processResponse(handler, response); } else { threadPool.executor(executor).execute(new Runnable() { @SuppressWarnings({"unchecked"}) @Override public void run() { processResponse(handler, response); } }); } } }
@Override public void sendResponse(TransportResponse response) throws IOException { sendResponse(response, TransportResponseOptions.EMPTY); }
@Override public void sendResponse(TransportResponse response) throws IOException { sendResponse(response, TransportResponseOptions.EMPTY); }
@Override public void run() { processResponse(handler, response); }
@SuppressWarnings({"unchecked"}) @Override public void run() { processException(handler, rtx); } });
@Override public void onFailure(Exception e) { try { channel.sendResponse(e); } catch (Exception inner) { inner.addSuppressed(e); logger.warn(() -> new ParameterizedMessage( "failed to notify channel of error message for action [{}]", action), inner); } } });
@Override public void sendResponse(final TransportResponse response, TransportResponseOptions options) throws IOException { adapter.onResponseSent(requestId, action, response, options); final TransportResponseHandler handler = adapter.onResponseReceived(requestId); // ignore if its null, the adapter logs it if (handler != null) { final String executor = handler.executor(); if (ThreadPool.Names.SAME.equals(executor)) { processResponse(handler, response); } else { threadPool.executor(executor).execute(() -> processResponse(handler, response)); } } }
@Override public void onFailure(Throwable e) { try { channel.sendResponse(e); } catch (Throwable e1) { logger.warn("failed to notify channel of error message for action [" + action + "]", e1); logger.warn("actual exception", e); } } });