|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.ref.Reference<T>
java.lang.ref.PhantomReference<java.lang.Object>
org.h2.util.CloseWatcher
public class CloseWatcher
A phantom reference to watch for unclosed objects.
| Field Summary | |
|---|---|
static java.lang.ref.ReferenceQueue<java.lang.Object> |
queue
The queue (might be set to null at any time). |
static java.util.HashSet<CloseWatcher> |
refs
The reference set. |
| Constructor Summary | |
|---|---|
CloseWatcher(java.lang.Object referent,
java.lang.ref.ReferenceQueue<java.lang.Object> q,
java.io.Closeable closeable)
|
|
| Method Summary | |
|---|---|
java.io.Closeable |
getCloseable()
|
java.lang.String |
getOpenStackTrace()
Get the open stack trace or null if none. |
static CloseWatcher |
pollUnclosed()
Check for an collected object. |
static CloseWatcher |
register(java.lang.Object o,
java.io.Closeable closeable,
boolean stackTrace)
Register an object. |
static void |
unregister(CloseWatcher w)
Unregister an object, so it is no longer tracked. |
| Methods inherited from class java.lang.ref.PhantomReference |
|---|
get |
| Methods inherited from class java.lang.ref.Reference |
|---|
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.ref.ReferenceQueue<java.lang.Object> queue
public static java.util.HashSet<CloseWatcher> refs
| Constructor Detail |
|---|
public CloseWatcher(java.lang.Object referent,
java.lang.ref.ReferenceQueue<java.lang.Object> q,
java.io.Closeable closeable)
| Method Detail |
|---|
public static CloseWatcher pollUnclosed()
public static CloseWatcher register(java.lang.Object o,
java.io.Closeable closeable,
boolean stackTrace)
o - the objectcloseable - the object to closestackTrace - whether the stack trace should be registered (this is
relatively slow)
public static void unregister(CloseWatcher w)
w - the referencepublic java.lang.String getOpenStackTrace()
public java.io.Closeable getCloseable()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||