/* ------------------------------------------------------------ */ @Override protected void doStop() throws Exception { if (isDumpBeforeStop()) dumpStdErr(); MultiException mex = new MultiException(); if (_graceful > 0) { if (_connectors != null) { for (int i = _connectors.length; i-- > 0; ) { LOG.info("Graceful shutdown {}", _connectors[i]); try { _connectors[i].close(); } catch (Throwable e) { mex.add(e); } } } Handler[] contexts = getChildHandlersByClass(Graceful.class); for (int c = 0; c < contexts.length; c++) { Graceful context = (Graceful) contexts[c]; LOG.info("Graceful shutdown {}", context); context.setShutdown(true); } Thread.sleep(_graceful); } if (_connectors != null) { for (int i = _connectors.length; i-- > 0; ) try { _connectors[i].stop(); } catch (Throwable e) { mex.add(e); } } try { super.doStop(); } catch (Throwable e) { mex.add(e); } mex.ifExceptionThrow(); if (getStopAtShutdown()) ShutdownThread.deregister(this); }
/** @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop() */ @Override public void doStop() throws Exception { ShutdownThread.deregister(this); _connectorServer.stop(); stopRegistry(); }
/* ------------------------------------------------------------ */ public void setStopAtShutdown(boolean stop) { _stopAtShutdown = stop; if (stop) ShutdownThread.register(this); else ShutdownThread.deregister(this); }