/** * Safely handle a close notification. * * @param handler the close handler * @param closed the object that was closed * @param exception the close exception, or {@code null} if the close succeeded * @param <T> the type of the closed resource */ public static <T> void safeHandleClose(final CloseHandler<? super T> handler, final T closed, final IOException exception) { try { if (handler != null && closed != null) handler.handleClose(closed, exception); } catch (Throwable t) { heLog.error("Close handler threw an exception", t); } }
public Key addCloseHandler(final CloseHandler<? super Endpoint> handler) { return endpoint.addCloseHandler((endpoint, ex) -> handler.handleClose(this, ex)); }
/** * Safely handle a close notification. * * @param handler the close handler * @param closed the object that was closed * @param exception the close exception, or {@code null} if the close succeeded * @param <T> the type of the closed resource */ public static <T> void safeHandleClose(final CloseHandler<? super T> handler, final T closed, final IOException exception) { try { if (handler != null && closed != null) handler.handleClose(closed, exception); } catch (Throwable t) { heLog.error("Close handler threw an exception", t); } }
/** * Safely handle a close notification. * * @param handler the close handler * @param closed the object that was closed * @param exception the close exception, or {@code null} if the close succeeded * @param <T> the type of the closed resource */ public static <T> void safeHandleClose(final CloseHandler<? super T> handler, final T closed, final IOException exception) { try { if (handler != null && closed != null) handler.handleClose(closed, exception); } catch (Throwable t) { heLog.error("Close handler threw an exception", t); } }
public Key addCloseHandler(final CloseHandler<? super Endpoint> handler) { return endpoint.addCloseHandler((endpoint, ex) -> handler.handleClose(this, ex)); }