com.scalagent.kjoram.util.Queue Class Reference

List of all members.

Public Member Functions

 Queue ()
synchronized void push (Object item)
synchronized Object pop ()
synchronized Object get () throws InterruptedException
void start ()
synchronized void stop () throws InterruptedException

Detailed Description

The 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.


Constructor & Destructor Documentation

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:


Member Function Documentation

synchronized void com.scalagent.kjoram.util.Queue.push ( Object  item  ) 

Pushes an item at the end of this queue.

Parameters:
item The item to be pushed at the end of this queue.
Exceptions:
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.

Returns:
The object at the top of this queue.
Exceptions:
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.

Returns:
The object at the top of this queue.

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.


The documentation for this class was generated from the following file:
Generated on Tue Sep 16 16:15:42 2008 for joram by  doxygen 1.5.0