Code example for SyncTaskExecutor

0
 
	private Semaphore semaphore;
 
	private volatile AtomicInteger count = new AtomicInteger(0);
 
	private TaskExecutor taskExecutor = new SyncTaskExecutor();
 
	/** 
	 * Create a {@link ThrottledTaskExecutor} with infinite 
	 * (Integer.MAX_VALUE) throttle limit. A task can always be submitted. 
	 */ 
	public ThrottledTaskExecutor() { 
		this(null, Integer.MAX_VALUE);
	} 
 
	/** 
	 * Create a {@link ThrottledTaskExecutor} with infinite 
	 * (Integer.MAX_VALUE) throttle limit. A task can always be submitted. 
	 *  
	 * @param taskExecutor the {@link TaskExecutor} to use