@Override public void shutdown() { //In FeedClientDDF, subscriptions are cleared on logout, do we want to do this here? messageTask.interrupt(); messageQueue.clear(); if (channel != null) { channel.close(); channel = null; } }
@Override public void shutdown() { //In FeedClientDDF, subscriptions are cleared on logout, do we want to do this here? messageTask.interrupt(); messageQueue.clear(); if (channel != null) { channel.close(); channel = null; } }
@Override protected void doShutdown(long timeout, TimeUnit unit) throws InterruptedException { datagramChannel.close().await(timeout, unit); bootstrap.releaseExternalResources(); }
/** * Shuts this {@link CoapClient} down by closing its * {@link org.jboss.netty.channel.socket.DatagramChannel} which includes to unbind * this {@link org.jboss.netty.channel.socket.DatagramChannel} from the listening port and by this means free the * port. */ public final void shutdown() { LOG.warn("Start to shutdown " + this.getApplicationName() + " (Port : " + this.getPort() + ")"); getChannel().close().awaitUninterruptibly().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { LOG.warn("Channel closed ({}).", CoapClient.this.getApplicationName()); getChannel().getFactory().releaseExternalResources(); LOG.warn("External resources released ({}).", CoapClient.this.getApplicationName()); LOG.warn("Shutdown of " + getApplicationName() + " completed."); } }); } }
@Override public void onSuccess(Void aVoid) { ChannelFuture channelClosedFuture = getChannel().close(); //Await the closure and let the factory release its external resource to finalize the shutdown channelClosedFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { LOG.warn("Server channel closed. Release external resources..."); getChannel().getFactory().releaseExternalResources(); } }); channelClosedFuture.awaitUninterruptibly().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { LOG.warn("Server shutdown completed!"); shutdownFuture.set(null); } }); }
@Override public void onSuccess(Void aVoid) { ChannelFuture channelClosedFuture = getChannel().close(); //Await the closure and let the factory release its external resource to finalize the shutdown channelClosedFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { LOG.warn("Endpoint channel closed. Release external resources..."); getChannel().getFactory().releaseExternalResources(); } }); channelClosedFuture.awaitUninterruptibly().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { LOG.warn("Endpoint shutdown completed!"); shutdownFuture.set(null); } }); }