All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.ref.ReferenceQueue
java.lang.Object
|
+----java.lang.ref.ReferenceQueue
- public class ReferenceQueue
- extends Object
Reference queues, to which registered reference objects are appended by the
garbage collector after the appropriate reachability changes are detected.
- Since:
- JDK1.2
- See Also:
- Reference
POLL- Timeout value that requests polling, that is, no blocking.
ReferenceQueue()
- Construct a new reference-object queue.
remove()
- Remove the next reference object in this queue, blocking until one
becomes available.
remove(long)
- Remove the next reference object in this queue, blocking until either
one becomes available or the given timeout period expires.
POLL
public static final long POLL
- Timeout value that requests polling, that is, no blocking.
ReferenceQueue
public ReferenceQueue()
- Construct a new reference-object queue.
remove
public Reference remove(long timeout) throws InterruptedException
- Remove the next reference object in this queue, blocking until either
one becomes available or the given timeout period expires.
- Parameters:
- timeout - If positive, block for up
timeout
milliseconds while waiting for a reference to be
added to this queue. If zero, block indefinitely.
If equal to POLL
, do not block.
- Returns:
- A reference, if one was available, otherwise
null
. If a reference is returned, it will no
longer be registered. - Throws:
InterruptedException
- If the timeout wait is interrupted
remove
public Reference remove() throws InterruptedException
- Remove the next reference object in this queue, blocking until one
becomes available. The returned reference will no longer be registered.
- Throws:
InterruptedException
- If the wait is interrupted
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature