private void attemptCleanClose() { long timeout = Integer.getInteger(WEBAPP_SHUTDOWN_TIMEOUT_PROPERTY, WEBAPP_SHUTDOWN_TIMEOUT_DEFAULT); if (timeout > 0) { log.info("jetty shutdown: requesting shutdown"); try { Connector[] connectors = server.getConnectors(); if (connectors != null) { for (Connector connector : connectors) { connector.shutdown(); } } int open = statistics.getRequestsActive(); if (open > 0) { waitForConnections(timeout, open); } } catch (Exception e) { log.warn("jetty shutdown: formal shutdown failed", e); } } }
private void attemptCleanClose() { long timeout = Integer.getInteger(WEBAPP_SHUTDOWN_TIMEOUT_PROPERTY, WEBAPP_SHUTDOWN_TIMEOUT_DEFAULT); if (timeout > 0) { logger.info("jetty shutdown: requesting shutdown"); try { Connector[] connectors = server.getConnectors(); if (connectors != null) { for (Connector connector : connectors) { connector.shutdown(); } } if (statistics != null && statistics.isStarted()) { int open = statistics.getRequestsActive(); if (open > 0) { waitForConnections(timeout, open); } } } catch (Exception e) { logger.warn("jetty shutdown: formal shutdown failed", e); } } }
protected void doShutdown(Request baseRequest, HttpServletResponse response) throws IOException { for (Connector connector : getServer().getConnectors()) { connector.shutdown(); } response.sendError(200, "Connectors closed, commencing full shutdown"); baseRequest.setHandled(true); final Server server=getServer(); new Thread() { @Override public void run () { try { shutdownServer(server); } catch (InterruptedException e) { LOG.ignore(e); } catch (Exception e) { throw new RuntimeException("Shutting down server",e); } } }.start(); }
protected void doShutdown(Request baseRequest, HttpServletResponse response) throws IOException { for (Connector connector : getServer().getConnectors()) { connector.shutdown(); } response.sendError(200, "Connectors closed, commencing full shutdown"); baseRequest.setHandled(true); final Server server=getServer(); new Thread() { @Override public void run () { try { shutdownServer(server); } catch (InterruptedException e) { LOG.ignore(e); } catch (Exception e) { throw new RuntimeException("Shutting down server",e); } } }.start(); }
protected void doShutdown(Request baseRequest, HttpServletResponse response) throws IOException { for (Connector connector : getServer().getConnectors()) { connector.shutdown(); } response.sendError(200, "Connectors closed, commencing full shutdown"); baseRequest.setHandled(true); final Server server=getServer(); new Thread() { @Override public void run () { try { shutdownServer(server); } catch (InterruptedException e) { LOG.ignore(e); } catch (Exception e) { throw new RuntimeException("Shutting down server",e); } } }.start(); }
futures.add(connector.shutdown());
futures.add(connector.shutdown());
futures.add(connector.shutdown());
futures.add(connector.shutdown());
futures.add(connector.shutdown());