/** * Release all the previous created channels. * This takes care of calling {@link LocalChannelRegistry#unregister(LocalAddress)} for each of them. */ public void releaseExternalResources() { group.close().awaitUninterruptibly(); }
@Override public ChannelGroupFuture close() { this.lock.writeLock().lock(); try { if (!this.closed.getAndSet(true)) { // First time close() is called. return super.close(); } else { Collection<ChannelFuture> futures = new ArrayList<>(); logger.debug("CleanupChannelGroup Already closed"); return new DefaultChannelGroupFuture(ChannelGroup.class.cast(this), futures); } } finally { this.lock.writeLock().unlock(); } }
public void stop() { if (this.channelGroup != null) { this.channelGroup.close(); } if (this.serverFactory != null) { this.serverFactory.releaseExternalResources(); } }
public void stop() { if (this.channelGroup != null) { this.channelGroup.close(); } if (this.serverFactory != null) { this.serverFactory.releaseExternalResources(); } }
static void closeAllConnections() { channels.close().awaitUninterruptibly(); }
@Override public ChannelGroupFuture close() { this.lock.writeLock().lock(); try { if (!this.closed.getAndSet(true)) { // First time close() is called. return super.close(); } else { Collection<ChannelFuture> futures = new ArrayList<ChannelFuture>(); logger.debug("CleanupChannelGroup Already closed"); return new DefaultChannelGroupFuture(ChannelGroup.class.cast(this), futures); } } finally { this.lock.writeLock().unlock(); } }
@Override public ChannelGroupFuture close() { this.lock.writeLock().lock(); try { if (!this.closed.getAndSet(true)) { // First time close() is called. return super.close(); } else { Collection<ChannelFuture> futures = new ArrayList<>(); logger.debug("CleanupChannelGroup Already closed"); return new DefaultChannelGroupFuture(ChannelGroup.class.cast(this), futures); } } finally { this.lock.writeLock().unlock(); } }
@Override public ChannelGroupFuture close() { this.lock.writeLock().lock(); try { if (!this.closed.getAndSet(true)) { // First time close() is called. return super.close(); } else { Collection<ChannelFuture> futures = new ArrayList<>(); logger.debug("CleanupChannelGroup Already closed"); return new DefaultChannelGroupFuture(ChannelGroup.class.cast(this), futures); } } finally { this.lock.writeLock().unlock(); } }
@Override public void shutdown() { LOG.info("Shutting down."); channels.close().awaitUninterruptibly(); channelFactory.releaseExternalResources(); }
public void stop() { log.info("terminating daemon; closing all channels"); ChannelGroupFuture future = allChannels.close(); future.awaitUninterruptibly(); if (!future.isCompleteSuccess()) { throw new RuntimeException("failure to complete closing all network channels"); } log.info("channels closed, freeing cache storage"); try { cache.close(); } catch (IOException e) { throw new RuntimeException("exception while closing storage", e); } channelFactory.releaseExternalResources(); running = false; log.info("successfully shut down"); }
@Override public void destroy() { timer.stop(); channelGroup.close().awaitUninterruptibly(); factory.releaseExternalResources(); }