Public Member Functions | |
| Queue () | |
| synchronized void | push (Object item) |
| synchronized Object | pop () |
| synchronized Object | get () throws InterruptedException |
| void | start () |
| synchronized void | stop () throws InterruptedException |
Queue class implements a First-In-First-Out (FIFO) list of objects.
A queue is for the exclusive use of one single consumer, whereas many producers may access it. It is ready for use after instanciation. A producer may wait for the queue to be empty by calling the stop() method. This method returns when the queue is actually empty, and prohibitis any further call to the push method. To be able to use the queue again, it must be re-started through the start() method.
Definition at line 37 of file Queue.java.
| com.scalagent.kjoram.util.Queue.Queue | ( | ) |
Constructs a Queue instance.
Definition at line 54 of file Queue.java.
References com.scalagent.kjoram.util.Queue.start().
Here is the call graph for this function:

| synchronized void com.scalagent.kjoram.util.Queue.push | ( | Object | item | ) |
Pushes an item at the end of this queue.
| item | The item to be pushed at the end of this queue. |
| StoppedQueueException | If the queue is stopping or stopped. |
Definition at line 67 of file Queue.java.
| synchronized Object com.scalagent.kjoram.util.Queue.pop | ( | ) |
Removes and returns the object at the top of this queue.
| EmptyQueueException | If the queue is empty. |
Definition at line 83 of file Queue.java.
| synchronized Object com.scalagent.kjoram.util.Queue.get | ( | ) | throws InterruptedException |
Waits for an object to be pushed in the queue, and eventually returns it without removing it.
Definition at line 106 of file Queue.java.
| void com.scalagent.kjoram.util.Queue.start | ( | ) |
Authorizes the use of the queue by producers.
Definition at line 116 of file Queue.java.
Referenced by com.scalagent.kjoram.util.Queue.Queue().
| synchronized void com.scalagent.kjoram.util.Queue.stop | ( | ) | throws InterruptedException |
Stops the queue by returning when it is empty and prohibiting any further producers call to the push method.
Definition at line 126 of file Queue.java.
1.5.0