|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.ncl.cs.instantsoap.queue.LoggingQueue<T>
public class LoggingQueue<T>
A queue that runs runnables and informs listeners.
Nested Class Summary | |
---|---|
static interface |
LoggingQueue.Listener<T>
A Listener that is informed when things are submitted to or completed by the list. |
Constructor Summary | |
---|---|
LoggingQueue(CompletionService<T> runner)
Create a new queue that uses the CompeltionService to run jobs. |
Method Summary | |
---|---|
void |
addListener(LoggingQueue.Listener<T> listener)
Add a listener to the queue. |
void |
removeListener(LoggingQueue.Listener<T> listener)
Remove the listener from the queue. |
Future<T> |
submit(Runnable job,
T ticket)
Subkit a runnable with a ticket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingQueue(CompletionService<T> runner)
CompeltionService
to run jobs.
runner
- the CompletionService
to useMethod Detail |
---|
public void addListener(LoggingQueue.Listener<T> listener)
listener
- the Listener
to addpublic void removeListener(LoggingQueue.Listener<T> listener)
listener
- the Listener
to removepublic Future<T> submit(Runnable job, T ticket)
job
- the Runnable
to be queuedticmet
- the ticket that uniquely identifies this job
Future
that will return the ticket when the job is completed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |