public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return INTERNAL_EXECUTOR_NAME; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return INTERNAL_EXECUTOR_NAME; }
public String getExecutorName() { Object obj = protocolHandler.getExecutor(); if (obj instanceof org.apache.catalina.Executor) { return ((org.apache.catalina.Executor) obj).getName(); } return "Internal"; }
@Override public int getBusyThreads() { Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getActiveCount(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getActiveCount(); } } return 0; }
@Override public int getMaxThreads() { Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor != null) { if (executor instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) executor).getMaximumPoolSize(); } else if (executor instanceof ResizableExecutor) { return ((ResizableExecutor) executor).getMaxThreads(); } } return 0; }
@Override public void onApplicationEvent(ContextClosedEvent event) { if (connector != null) { this.connector.pause(); Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor instanceof ThreadPoolExecutor) { try { ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; threadPoolExecutor.shutdown(); if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) { log.warn("Tomcat thread pool did not shut down gracefully within " + "30 seconds. Proceeding with forceful shutdown"); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } } }
/** * Perform a pause on the server. * @throw InterruptedException if we have an interruption */ public void pause() { // Used to properly handle the work queue. final Executor executor = connector.getProtocolHandler().getExecutor(); // Start the pause. connector.pause(); }
@Override public void onApplicationEvent(ContextClosedEvent event) { this.connector.pause(); log.info("Shutting Down LivingDoc Remote Agent"); Executor executor = this.connector.getProtocolHandler().getExecutor(); if (executor instanceof ThreadPoolExecutor) { try { ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; threadPoolExecutor.shutdown(); if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) { log.warn("Tomcat thread pool did not shut down gracefully within " + "30 seconds. Proceeding with forceful shutdown"); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } }
return; final Executor executor = connector.getProtocolHandler().getExecutor(); if (executor instanceof ThreadPoolExecutor) { log.info("executor is ThreadPoolExecutor");
/** * Perform a shutdown * @param delay is delay to force is the delay before perform a force shutdown * @throws InterruptedException if we have an exception */ public void shutdown(Integer delay) throws InterruptedException { // Used to properly handle the work queue. final Executor executor = connector.getProtocolHandler().getExecutor(); final ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; /* * Initiates an orderly shutdown in which previously submitted * tasks are executed, but no new tasks will be accepted. * Invocation has no additional effect if already shut down. */ threadPoolExecutor.shutdown(); // We wait after the end of the current requests if(!threadPoolExecutor.awaitTermination(delay, TimeUnit.SECONDS)) { logger.warn("Tomcat thread pool did not shut down gracefully within " + delay + " second(s). Proceeding with force shutdown"); } else { logger.debug("Tomcat thread pool is empty, we stop now"); } }
Executor executor = null; if (handler != null) { executor = handler.getExecutor();
Executor executor = null; if (handler != null) { executor = handler.getExecutor();
Executor executor = null; if (handler != null) { executor = handler.getExecutor();
Executor executor = null; if (handler != null) { executor = handler.getExecutor();
Executor executor = null; if (handler != null) { executor = handler.getExecutor();