Code example for ThreadPoolExecutor

Methods: executegetActiveCountgetCompletedTaskCountgetPoolSizegetTaskCount

0
//		executor=(ScheduledThreadPoolExecutor)Executors.newScheduledThreadPool(1); 
	} 
 
	public void executeTask(TestDBTask task) {
		System.out.printf("Server: A new task has arrived\n");
		executor.execute(task);
		System.out.printf("Server: Pool Size: %d\n", executor.getPoolSize());
		System.out.printf("Server: Active Count: %d\n", executor.getActiveCount());
		System.out.printf("Server: Completed Tasks: %d\n", executor.getCompletedTaskCount());
 
		System.out.printf("Server: TestDBTask Count: %d\n", executor.getTaskCount());
	} 
 
	public void endServer() { 
		executor.shutdown();
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java