|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ref.ReferenceQueue<T>
public class ReferenceQueue<T>
This is the queue, where references can enqueue themselve on. Each reference may be registered to a queue at initialization time and will be appended to the queue, when the enqueue method is called. The enqueue method may be automatically called by the garbage collector if it detects, that the object is only reachable through the Reference objects.
Reference.enqueue()
Constructor Summary | |
---|---|
ReferenceQueue()
Creates a new empty reference queue. |
Method Summary | |
---|---|
Reference<? extends T> |
poll()
Checks if there is a reference on the queue, returning it immediately. |
Reference<? extends T> |
remove()
Removes a reference from the queue, blocking until a reference is enqueued. |
Reference<? extends T> |
remove(long timeout)
Removes a reference from the queue, blocking for timeout
until a reference is enqueued. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReferenceQueue()
Method Detail |
---|
public Reference<? extends T> poll()
null
otherwise.public Reference<? extends T> remove(long timeout) throws InterruptedException
timeout
until a reference is enqueued.
timeout
- the timeout period in milliseconds, 0
means
wait forever.
null
if timeout period expired.
InterruptedException
- if the wait was interrupted.public Reference<? extends T> remove() throws InterruptedException
InterruptedException
- if the wait was interrupted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |