Code example for ExecutorService

Methods: isShutdown

0
		this.threadSize = threadSize;
		executorService = Executors.newFixedThreadPool(threadSize);
	} 
	 
	public void init() { 
		if(executorService.isShutdown()) {
			executorService = Executors.newFixedThreadPool(threadSize);
		} 
	} 
	 
	public <T> T addJob(Job<T> job) throws InterruptedException, ExecutionException {
		Future<T> f = executorService.submit(job);
		return f.get();
	} 
	 
	public void destory() { 
		executorService.shutdownNow();
	} 
 
	public int getThreadSize() { 
		return threadSize;