Example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor getThreadNamePrefix

List of usage examples for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor getThreadNamePrefix

Introduction

In this page you can find the example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor getThreadNamePrefix.

Prototype

public String getThreadNamePrefix() 

Source Link

Document

Return the thread name prefix to use for the names of newly created threads.

Usage

From source file:org.springframework.integration.monitor.IntegrationMBeanExporter.java

@ManagedOperation
public void stopExecutors() {
    if (logger.isDebugEnabled()) {
        logger.debug("Stopping executors" + (this.shutdownForced ? "(force)" : ""));
    }//from   www.j  a  v  a  2 s .  c o  m
    List<ExecutorService> executorServices = new ArrayList<ExecutorService>();
    Map<String, ThreadPoolTaskExecutor> executors = this.applicationContext
            .getBeansOfType(ThreadPoolTaskExecutor.class);
    for (Entry<String, ThreadPoolTaskExecutor> entry : executors.entrySet()) {
        ThreadPoolTaskExecutor executor = entry.getValue();
        if (executor == this.shutdownExecutor) {
            logger.debug("Skipping shutdown of shutdown executor");
        } else {
            if (logger.isInfoEnabled()) {
                logger.info("Stopping executor " + executor.getThreadNamePrefix());
            }
            ExecutorService executorService = executor.getThreadPoolExecutor();
            executorServices.add(executorService);
            doShutdownExecutorService(executorService);
        }
    }
    waitForExecutors(executorServices);
    logger.debug("Stopped executors");
}