|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.droids.impl.SimpleTaskQueue<T>
public class SimpleTaskQueue<T extends Task>
A simple
| Constructor Summary | |
|---|---|
SimpleTaskQueue()
Simple queue constructor. |
|
SimpleTaskQueue(java.util.Queue queue)
|
|
| Method Summary | |
|---|---|
void |
clear()
|
int |
getMaxSize()
|
int |
getSize()
How many task do we have left in the queue. |
T |
getTask(java.lang.String id)
Return the task that is identified with the given id |
TaskValidator<T> |
getTaskValidator()
|
boolean |
hasNext()
Do we have more task waiting for service |
void |
merge(java.util.Collection<? extends T> tasks)
Tasks with duplicate keys will be overwritten |
void |
merge(T task)
Add a Task to the queue... |
T |
next()
Return the next task that is waiting for service |
java.util.Collection<? extends T> |
peek(int size)
Get the top 'size' elements in the queue |
void |
setMaxSize(int maxSize)
|
void |
setTaskValidator(TaskValidator<T> taskValidator)
|
T |
validateTask(T task)
This will take a task and make sure it is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleTaskQueue()
public SimpleTaskQueue(java.util.Queue queue)
| Method Detail |
|---|
public T getTask(java.lang.String id)
TaskQueue
getTask in interface TaskQueue<T extends Task>id - of the task we want
public int getSize()
TaskQueue
getSize in interface TaskQueue<T extends Task>public boolean hasNext()
TaskQueue
hasNext in interface TaskQueue<T extends Task>
public void merge(T task)
throws InvalidTaskException
TaskQueue
merge in interface TaskQueue<T extends Task>task - task to add to the Queue
InvalidTaskException
public void merge(java.util.Collection<? extends T> tasks)
throws InvalidTaskException
merge in interface TaskQueue<T extends Task>tasks - the list of task that we want to add to the queue
InvalidTaskExceptionpublic T next()
TaskQueue
next in interface TaskQueue<T extends Task>public void clear()
public T validateTask(T task)
throws InvalidTaskException
TaskValidator
validateTask in interface TaskValidator<T extends Task>InvalidTaskExceptionpublic TaskValidator<T> getTaskValidator()
public void setTaskValidator(TaskValidator<T> taskValidator)
public int getMaxSize()
public void setMaxSize(int maxSize)
public java.util.Collection<? extends T> peek(int size)
TaskQueue
peek in interface TaskQueue<T extends Task>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||