|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.jcr.rmi.api.observation.Queue
public class Queue
The Queue class is a very simple queue assuming that there is at least one consumer
and potentially multiple producers. This class poses no restrictions on the size of the queue.
| Constructor Summary | |
|---|---|
Queue()
Creates an instance of this queue. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(long timeout)
Returns the first element from the queue. |
void |
put(java.lang.Object object)
Appends the given object to the end of the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public void put(java.lang.Object object)
object to the end of the queue.
After appending the element, the queue is notified such that threads waiting to retrieve an element from the queue are woken up.
object - the object to be added
public java.lang.Object get(long timeout)
throws java.lang.InterruptedException
timeout - The maximum number of milliseconds to wait for an entry in the queue if the queue is
empty. If zero, the method waits forever for an element.
null if the method timed out waiting for
an entry.
java.lang.InterruptedException - Is thrown if the current thread is interrupted while waiting for the queue to get at
least one entry.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||