List of usage examples for java.util.concurrent ThreadPoolExecutor toString
public String toString()
From source file:eu.artofcoding.beetlejuice.spring.SpringContextHelper.java
private void stopExecutors() { ThreadPoolTaskExecutor springTaskExecutor = applicationContext.getBean("taskExecutor", ThreadPoolTaskExecutor.class); ThreadPoolExecutor springExecutor = springTaskExecutor.getThreadPoolExecutor(); springExecutor.shutdownNow();//from w w w . jav a 2 s. com Map<String, ThreadPoolTaskExecutor> map = applicationContext.getBeansOfType(ThreadPoolTaskExecutor.class); ThreadPoolTaskExecutor t = null; for (String key : map.keySet()) { t = map.get(key); final ThreadPoolExecutor executor = t.getThreadPoolExecutor(); executor.shutdownNow(); logger.info( String.format("%s: active after shutdown: %d", executor.toString(), executor.getActiveCount())); logger.info(String.format("%s: completed after shutdown: %d", executor.toString(), executor.getCompletedTaskCount())); } }