public class Cleaner
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Cleaner.Cleanable
Returned by the register method to allow the caller to clean up the object
manually and be sure that the method is not called again.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
getInstance()
Returns a lazily initialized, global, static Cleaner object if the current Java version supports it.
|
static Cleaner.Cleanable |
register(java.lang.Object object)
Registers an object for cleanup.
|
static Cleaner.Cleanable |
register(java.lang.Object object,
java.lang.Runnable runnable)
Registers an object for cleanup.
|
public static java.lang.Object getInstance()
public static Cleaner.Cleanable register(java.lang.Object object, java.lang.Runnable runnable)
object - the object to register for cleanuprunnable - the runnable that provides the cleanup methodpublic static Cleaner.Cleanable register(java.lang.Object object)
object - the object to register for cleanup