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

Variable Index

 o POLL
Timeout value that requests polling, that is, no blocking.

Constructor Index

 o ReferenceQueue()
Construct a new reference-object queue.

Method Index

 o remove()
Remove the next reference object in this queue, blocking until one becomes available.
 o remove(long)
Remove the next reference object in this queue, blocking until either one becomes available or the given timeout period expires.

Variables

 o POLL
public static final long POLL
Timeout value that requests polling, that is, no blocking.

Constructors

 o ReferenceQueue
public ReferenceQueue()
Construct a new reference-object queue.

Methods

 o 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
 o 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