Code example for ThreadPoolExecutor

0
	public void contextInitialized(ServletContextEvent sce) {
		logger.info("*********************************");
		logger.info("Context Listener > Initialized");
		logger.info("*********************************");
		// 2. Creation of a global async Executor 
		Executor executor = new ThreadPoolExecutor(10, 10, 50000L,
				TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(100));
		sce.getServletContext().setAttribute("executor", executor);
	} 
 
	public void contextDestroyed(ServletContextEvent sce) {
	} 
 
}