/** * Whether the given exception indicates that the currently accessed stream has been closed. */ public static boolean indicatesStreamClosed(Throwable thr) { return thr instanceof InterruptedIOException || thr instanceof ClosedChannelException || thr instanceof SocketException && ("Connection reset".equals(thr.getMessage()) || "Socket closed".equals(thr.getMessage())) || thr instanceof JsonRpcException && indicatesStreamClosed(thr.getCause()); }
/** * Whether the given exception indicates that the currently accessed stream has been closed. */ public static boolean indicatesStreamClosed(Throwable thr) { return thr instanceof InterruptedIOException || thr instanceof ClosedChannelException || thr instanceof SocketException && ("Connection reset".equals(thr.getMessage()) || "Socket closed".equals(thr.getMessage())) || thr instanceof JsonRpcException && indicatesStreamClosed(thr.getCause()); }
/** * Send a notification to the remote endpoint. */ @Override public void notify(String method, Object parameter) { NotificationMessage notificationMessage = createNotificationMessage(method, parameter); try { out.consume(notificationMessage); } catch (Exception exception) { Level logLevel = JsonRpcException.indicatesStreamClosed(exception) ? Level.INFO : Level.WARNING; LOG.log(logLevel, "Failed to send notification message.", exception); } }
/** * Send a notification to the remote endpoint. */ @Override public void notify(String method, Object parameter) { NotificationMessage notificationMessage = createNotificationMessage(method, parameter); try { out.consume(notificationMessage); } catch (Exception exception) { Level logLevel = JsonRpcException.indicatesStreamClosed(exception) ? Level.INFO : Level.WARNING; LOG.log(logLevel, "Failed to send notification message.", exception); } }
if (JsonRpcException.indicatesStreamClosed(exception)) fireStreamClosed(exception); else
if (JsonRpcException.indicatesStreamClosed(exception)) fireStreamClosed(exception); else