public synchronized void close() throws IOException { log.trace("close()"); switch (state) { case UNUSED: case CLOSED: return; case OPEN: state = ConnectorState.CLOSED; } final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } safeClose(versionedConnection); safeClose(channel); safeClose(connection); safeClose(endpoint); }
private void safeClose(final Channel channel) { if (channel != null) { try { channel.writeShutdown(); } catch (Exception ignored) { } } safeClose((Closeable) channel); }
public synchronized void close() throws IOException { log.trace("close()"); switch (state) { case UNUSED: case CLOSED: return; case OPEN: state = ConnectorState.CLOSED; } final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } safeClose(versionedConnection); safeClose(channel); safeClose(connection); safeClose(endpoint); }
public synchronized void close() throws IOException { log.trace("close()"); switch (state) { case UNUSED: case CLOSED: return; case OPEN: state = ConnectorState.CLOSED; } final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } safeClose(versionedConnection); safeClose(channel); safeClose(connection); safeClose(endpoint); }
private void safeClose(final Channel channel) { if (channel != null) { try { channel.writeShutdown(); } catch (Exception ignored) { } } safeClose((Closeable) channel); }
private void safeClose(final Channel channel) { if (channel != null) { try { channel.writeShutdown(); } catch (Exception ignored) { } } safeClose((Closeable) channel); }