public class WorkQueue extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
WorkQueue.CancelableRunnable
Runnable needing to know it was canceled.
|
static interface |
WorkQueue.CanceledWhileRunning
Base interface handles the case when task was canceled before actual execution and in case it
was started cancel method is not called yet the task itself will be destroyed anyway (it will
result in resource opening errors).
|
class |
WorkQueue.Executor
An isolated queue.
|
static class |
WorkQueue.Lifecycle |
static class |
WorkQueue.Module |
static class |
WorkQueue.ProjectTask<V>
Same as Task class, but with a reference to ProjectRunnable, used to retrieve the project name
from the operation queued
|
static class |
WorkQueue.Task<V>
A wrapper around a scheduled Runnable, as maintained in the queue.
|
Constructor and Description |
---|
WorkQueue(IdGenerator idGenerator,
int defaultThreadPoolSize) |
Modifier and Type | Method and Description |
---|---|
WorkQueue.Executor |
createQueue(int poolsize,
String prefix)
Create a new executor queue.
|
WorkQueue.Executor |
getDefaultQueue()
Get the default work queue, for miscellaneous tasks.
|
WorkQueue.Executor |
getExecutor(String queueName) |
WorkQueue.Task<?> |
getTask(int id)
Locate a task by its unique id, null if no task matches.
|
<T> List<T> |
getTaskInfos(TaskInfoFactory<T> factory) |
List<WorkQueue.Task<?>> |
getTasks()
Get all of the tasks currently scheduled in any work queue.
|
public WorkQueue(IdGenerator idGenerator, int defaultThreadPoolSize)
public WorkQueue.Executor getDefaultQueue()
public WorkQueue.Executor createQueue(int poolsize, String prefix)
public List<WorkQueue.Task<?>> getTasks()
public <T> List<T> getTaskInfos(TaskInfoFactory<T> factory)
public WorkQueue.Task<?> getTask(int id)
public WorkQueue.Executor getExecutor(String queueName)