public final class ObjectCleaner
extends java.lang.Object
Runnable
that will executed once there are no references to an Object
anymore.限定符和类型 | 方法和说明 |
---|---|
static int |
getLiveSetCount() |
static void |
register(java.lang.Object object,
java.lang.Runnable cleanupTask)
Register the given
Object for which the Runnable will be executed once there are no references
to the object anymore. |
public static void register(java.lang.Object object, java.lang.Runnable cleanupTask)
Object
for which the Runnable
will be executed once there are no references
to the object anymore.
This should only be used if there are no other ways to execute some cleanup once the Object is not reachable
anymore because it is not a cheap way to handle the cleanup.public static int getLiveSetCount()