org.jboss.errai.bus.server.async.scheduling
Class PooledExecutorService
java.lang.Object
org.jboss.errai.bus.server.async.scheduling.PooledExecutorService
- All Implemented Interfaces:
- TaskProvider
public class PooledExecutorService
- extends Object
- implements TaskProvider
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PooledExecutorService
public PooledExecutorService(int queueSize)
- Constructs a new PooledExecutorService with the specified queue size.
- Parameters:
queueSize
- The size of the underlying worker queue.
PooledExecutorService
public PooledExecutorService(int queueSize,
PooledExecutorService.SaturationPolicy saturationPolicy)
execute
public void execute(Runnable runnable)
throws InterruptedException
- Schedule a task for immediate execution.
- Parameters:
runnable
- Runnable task
- Throws:
InterruptedException
- thrown if the thread waiting for an empty spot on the execution queue is
interrupted.
schedule
public AsyncTask schedule(Runnable runnable,
TimeUnit unit,
long interval)
scheduleRepeating
public AsyncTask scheduleRepeating(Runnable runnable,
TimeUnit unit,
long initial,
long interval)
start
public void start()
shutdown
public void shutdown()
getNextTask
public TimedTask getNextTask()
throws InterruptedException
- Returns the next Runnable task that is currently due to run. This method will block until a task is available.
- Specified by:
getNextTask
in interface TaskProvider
- Returns:
- Runnable task.
- Throws:
InterruptedException
- thrown if the thread waiting on a ready task is interrupted.
requestStop
public void requestStop()
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.