public class PreferenceQueueService extends java.lang.Object implements LifecycleQueueService
ASYNCHRONOUS_QUEUE_MODE, GLOABL_QUEUE_SCOPE, PREFERENCE_QUEUE_MODE, QUEUE_MODE_PROPERTY, QUEUE_SCOPE_PROPERTY, SYNCHRONOUS_QUEUE_MODE| Constructor and Description |
|---|
PreferenceQueueService(PreferenceSelection strategy,
LifecycleQueueService syncQueue,
LifecycleQueueService asyncQueue)
Creates the preference queue service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addQueueListener(QueueListener listener)
Add a
QueueListener that will be notified on events relative to this QueueService. |
int |
getCurrents() |
int |
getFinished() |
int |
getWaiters() |
java.util.List<JobInfo> |
getWaitersInfo()
Gets the number of waiting job.
|
void |
removeQueueListener(QueueListener listener)
Remove a
QueueListener from this QueueService. |
void |
start()
Starting queues.
|
void |
stop()
Stopping queues.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable)
Submits a job to the queue service.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable,
Callback<T> callback,
java.lang.String description)
Submits a job to the right queue.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable,
java.lang.String description)
Submits a job to the queue service.
|
public PreferenceQueueService(PreferenceSelection strategy, LifecycleQueueService syncQueue, LifecycleQueueService asyncQueue)
strategy - the preference strategysyncQueue - the synchronous queue serviceasyncQueue - the asynchronous queue servicepublic int getFinished()
getFinished in interface QueueServicepublic int getWaiters()
getWaiters in interface QueueServicepublic int getCurrents()
getCurrents in interface QueueServicepublic java.util.List<JobInfo> getWaitersInfo()
getWaitersInfo in interface QueueServicepublic <T> java.util.concurrent.Future<T> submit(Job<T> callable, Callback<T> callback, java.lang.String description)
submit in interface QueueServicecallable - the jobcallback - callback called when the job is processeddescription - a description of the jobpublic <T> java.util.concurrent.Future<T> submit(Job<T> callable, java.lang.String description)
QueueServicesubmit in interface QueueServicecallable - the jobdescription - a description of the jobpublic <T> java.util.concurrent.Future<T> submit(Job<T> callable)
QueueServicesubmit in interface QueueServicecallable - the jobpublic void addQueueListener(QueueListener listener)
QueueServiceQueueListener that will be notified on events relative to this QueueService.addQueueListener in interface QueueServicelistener - added listenerpublic void removeQueueListener(QueueListener listener)
QueueServiceQueueListener from this QueueService.removeQueueListener in interface QueueServicelistener - removed listenerCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.