/** * Shuts down the web server. */ public void stop() throws Exception { // close all connectors and release all binding ports for (Connector connector : mServer.getConnectors()) { connector.stop(); } mServer.stop(); }
@Override synchronized public void removeConnector(String host, int port) { Connector[] connectors = server.getConnectors(); for (Connector connector : connectors) { if (connector.getHost().equals(host) && connector.getLocalPort() == port) { if (connector.isStarted() || connector.isStarting()) { try { connector.stop(); } catch (Exception ex) { log.severe("Couldn't stop connector: " + connector + " " + ex); throw new RuntimeException(ex); } } server.removeConnector(connector); if (connectors.length == 1) { log.info("No more connectors, stopping Jetty server"); stopIfRunning(); } break; } } }
/** * Shuts down the web server. */ public void stop() throws Exception { // close all connectors and release all binding ports for (Connector connector : mServer.getConnectors()) { connector.stop(); } mServer.stop(); }
@Override public final void stopJetty() throws Exception { server.stop(); for( Connector connector : server.getConnectors() ) { connector.stop(); } server = null; }
@Override public void stop() throws MuleException { try { connector.stop(); started = false; } catch (Exception e) { logger.warn("Jetty connector did not close cleanly: " + e.getMessage()); } }
@Override public final void stopJetty() throws Exception { server.stop(); for( Connector connector : server.getConnectors() ) { connector.stop(); } server = null; }
@Override public final void stopJetty() throws Exception { server.stop(); for( Connector connector : server.getConnectors() ) { connector.stop(); } server = null; }
/** * @throws Exception */ @Override protected void shutDown() throws Exception { if (server == null) { LOGGER.error("Server is already stopped"); } else { LOGGER.debug("stopping {}", serviceName()); try { for (Connector c : server.getConnectors()) { c.stop(); } } finally { server.stop(); server = null; } LOGGER.debug("stopped {}", serviceName()); } } }
/** * @throws Exception */ @Override protected void shutDown() throws Exception { if (server == null) { LOGGER.error("Server is already stopped"); } else { LOGGER.debug("stopping {}", serviceName()); try { for (Connector c : server.getConnectors()) { c.stop(); } } finally { server.stop(); server = null; } LOGGER.debug("stopped {}", serviceName()); } } }
/** * We need to stop only the connectors because if we stop {@link #server}, then it will remove all the registered * REST services from it. */ public void stop() { final List<Exception> exceptions = new ArrayList<>(); final Connector[] connectors = this.server.getConnectors(); if (connectors != null) { for (final Connector c : connectors) { try { c.stop(); } catch (Exception e) { exceptions.add(e); } } } if (!exceptions.isEmpty()) { JBIException jbiException = new JBIException("Error while stopping RESTServer"); for (final Exception e : exceptions) { jbiException.addSuppressed(e); } } }
/** * This method is called by the ServerEngine Factory to destroy the * listener. * */ protected void stop() throws Exception { registedPaths.clear(); if (server != null) { try { connector.stop(); connector.close(); } finally { server.stop(); server.destroy(); server = null; } } }
@Override synchronized public void removeConnector(String host, int port) { Connector[] connectors = server.getConnectors(); for (Connector connector : connectors) { if (connector.getHost().equals(host) && connector.getLocalPort() == port) { if (connector.isStarted() || connector.isStarting()) { try { connector.stop(); } catch (Exception ex) { log.severe("Couldn't stop connector: " + connector + " " + ex); throw new RuntimeException(ex); } } server.removeConnector(connector); if (connectors.length == 1) { log.info("No more connectors, stopping Jetty server"); stopIfRunning(); } break; } } }
@Override public void removedService(ServiceReference<ConnectorFactory> reference, Connector service) { Connector connector = service; if (connector.isStarted()) { try { connector.stop(); } catch (Exception e) { SystemLogger.info("Failed stopping connector '" + connector + "' provided by " + reference + ": " + e); } } this.server.removeConnector(connector); } }
try { if (connector != null) { connector.stop(); if (connector instanceof Closeable) { ((Closeable)connector).close();
try { if (connector != null) { connector.stop(); if (connector instanceof Closeable) { ((Closeable)connector).close();
try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}