Code example for ThreadPoolExecutor

Methods: getPoolSize

0
		int current = count.get();
		int tps = current-last;
		System.out.println(tps+" tps/s");
		last = current;
		if(workerThreadPool!=null){
			System.out.println("worker thread pool size = "+workerThreadPool.getPoolSize());
		} 
	} 
	private AtomicInteger count = new AtomicInteger(0);
	private Timer timer = new Timer();
	public StatMessageHandler(){ 
		this.timer.schedule(this, 10, 1000);
	} 
	 
	public void handle(SessionHandler session,Object message) {
		count.getAndIncrement();
		if(workerThreadPool==null){
			workerThreadPool = (ThreadPoolExecutor)session.getExecutorService();
		} 
	} 
}