/** * Stop the Controller by canceling all the registered keys. */ public void stop() throws IOException { stop(false); }
/** * Stop controller in seperate thread * * @param controller the controller */ public static void stopController(Controller controller) { try { controller.stop(); } catch(IOException e) { } }
public void stopEndpoint() { if (!running) return; running = false; try{ controller.stop(); } catch (IOException ex){ logger.log(Level.WARNING, sm.getString("stopException"),ex); } synchronized(lock){ // Wait for the main thread to stop. clearTasks(); } }
@Override public synchronized void stop() throws Exception { super.stop(); if (this.controller != null) { getLogger().info( "Stopping the Grizzly " + getProtocols() + " server"); this.controller.stop(); } } }
public void stopEndpoint() { if (!running.getAndSet(false)) return; try{ controller.stop(); } catch (IOException ex){ if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, LogMessages.WARNING_GRIZZLY_HTTP_SELECTOR_THREAD_STOP(), ex); } } synchronized(lock){ // Wait for the main thread to stop. clearTasks(); } if (adapter instanceof GrizzlyAdapter){ ((GrizzlyAdapter)adapter).destroy(); } }
@Override public synchronized void stop() throws IOException { if( !running ) return; running = false; super.stop(); if( tcpSender != null ) tcpSender.stop(); if( udpSender != null ) udpSender.stop(); if( multicastSender != null ) multicastSender.stop(); if( multicastSenderThreadPool != null ) { multicastSenderThreadPool.shutdown(); } peerIDMap.clear(); selectionKeyMap.clear(); pingMessageLockMap.clear(); controller.stop(); execService.shutdown(); }
/** * Close the underlying connection. */ public void close() throws IOException{ if (socketChannel != null){ if (selectorHandler != null){ SelectionKey key = socketChannel.keyFor(selectorHandler.getSelector()); if (key == null) return; selectorHandler.getSelectionKeyHandler().cancel(key); } else { socketChannel.close(); } } if (controller != null && isStandalone){ controller.stop(); controller = null; } isStandalone = false; isConnected = false; connectionTimeout = DEFAULT_CONNECTION_TIMEOUT; }
readController.stop(); } catch (IOException e) { logger.log(Level.WARNING, "Exception occured when stopping read Controller!", e);
controller.stop(); controller = null;
/** * Close the underlying connection. */ public void close() throws IOException{ if (datagramChannel != null){ if (selectorHandler != null){ SelectionKey key = datagramChannel.keyFor(selectorHandler.getSelector()); if (key == null) return; selectorHandler.getSelectionKeyHandler().cancel(key); } else { datagramChannel.close(); } } if (controller != null && isStandalone){ controller.stop(); controller = null; } isStandalone = false; isConnected = false; }