Code example for ThreadPoolExecutor

Methods: getQueue

0
 
	/** 
	 * @see net.gaia.taskprocessor.api.processor.WaitingTaskProcessor#getPendingTaskCount() 
	 */ 
	public int getPendingTaskCount() { 
		return executor.getQueue().size();
	} 
 
	public static CachedThreadWaitingProcessor create(final WorkParallelizer parallelizer) {
		final CachedThreadWaitingProcessor processor = new CachedThreadWaitingProcessor();
		final ProcessorThreadFactory threadFactory = ProcessorThreadFactory.create(WAITING_PROCESSOR_THREAD_NAMES,
				processor);
		processor.executor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS,
				new SynchronousQueue<Runnable>(), threadFactory);
		processor.parallelizer = parallelizer;
		return processor;
	} 
 
	/** 
	 * @see net.gaia.taskprocessor.api.processor.Detenible#detener() 
	 */