public class PooledExecutorService extends Object implements TaskProvider
Modifier and Type | Class and Description |
---|---|
static class |
PooledExecutorService.SaturationPolicy
Enumeration of possible ways of handling a queue full scenario.
|
Constructor and Description |
---|
PooledExecutorService(int queueSize)
Constructs a new PooledExecutorService with the specified queue size.
|
PooledExecutorService(int queueSize,
PooledExecutorService.SaturationPolicy saturationPolicy) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable runnable)
Schedule a task for immediate execution.
|
TimedTask |
getNextTask()
Returns the next Runnable task that is currently due to run.
|
void |
requestStop() |
AsyncTask |
schedule(Runnable runnable,
TimeUnit unit,
long interval) |
AsyncTask |
scheduleRepeating(Runnable runnable,
TimeUnit unit,
long initial,
long interval) |
void |
shutdown() |
void |
start() |
public PooledExecutorService(int queueSize)
queueSize
- The size of the underlying worker queue.public PooledExecutorService(int queueSize, PooledExecutorService.SaturationPolicy saturationPolicy)
public void execute(Runnable runnable) throws InterruptedException
runnable
- Runnable taskInterruptedException
- thrown if the thread waiting for an empty spot on the execution queue is
interrupted.public AsyncTask scheduleRepeating(Runnable runnable, TimeUnit unit, long initial, long interval)
public void start()
public void shutdown()
public TimedTask getNextTask() throws InterruptedException
getNextTask
in interface TaskProvider
InterruptedException
- thrown if the thread waiting on a ready task is interrupted.public void requestStop()
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.