|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<E>
com.sun.sgs.impl.util.ManagedQueue<E>
E - the type for elements in the queue
TODO: The element type should not be required to be a managed object,
but should just be serializable. Should it handle both?public class ManagedQueue<E>
A simple implementation of a persistent queue. When an element is removed from the queue, that element is also removed from the data store.
Note: The size and iterator methods are not
supported.
Note: If a given instance of ManagedQueue contains a large
number of elements, invoking the clear method on the queue may
be a lengthy operation. Therefore, the queue should either contain a
smaller number of elements, or elements should be removed from the queue
a few at at time.
| Constructor Summary | |
|---|---|
ManagedQueue()
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isEmpty()
|
Iterator<E> |
iterator()
|
boolean |
offer(E o)
|
E |
peek()
|
E |
poll()
|
void |
removingObject()
Performs additional operations that are needed when this object is removed. |
int |
size()
|
String |
toString()
|
| Methods inherited from class java.util.AbstractQueue |
|---|
add, addAll, clear, element, remove |
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public ManagedQueue()
| Method Detail |
|---|
public boolean offer(E o)
offer in interface Queue<E>public E peek()
peek in interface Queue<E>public E poll()
poll in interface Queue<E>public int size()
This method is not supported.
size in interface Collection<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in class AbstractCollection<E>public Iterator<E> iterator()
This method is not supported.
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public int hashCode()
hashCode in interface Collection<E>hashCode in class Objectpublic boolean equals(Object o)
equals in interface Collection<E>equals in class Objectpublic String toString()
toString in class AbstractCollection<E>public void removingObject()
This implementation clears all elements from the queue, thus removing all elements from the data store. TODO: For queues with a large number of elements, removing the enqueued elements should be performed in a separate task (or tasks).
removingObject in interface ManagedObjectRemoval
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||