public class Disposer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Disposer.Record
This interface is used to hold the resource to be disposed.
|
static interface |
Disposer.Target
This is an interface which should be implemented by
the classes which use Disposer.
|
Modifier and Type | Method and Description |
---|---|
static void |
addRecord(Object target,
Disposer.Record rec)
Registers the target object and the native data for later disposal when
the target is unreachable.
|
static void |
cleanUp()
Disposes all unreachable objects and all objects in the disposal queue.
|
static void |
disposeRecord(Disposer.Record rec)
Add the object to the disposal queue.
|
public static void addRecord(Object target, Disposer.Record rec)
target
- Object to be registeredrec
- the associated DisposerRecord objectDisposerRecord
public static void disposeRecord(Disposer.Record rec)
rec
- the DisposerRecord object to be disposedpublic static void cleanUp()
Copyright © 2020. All rights reserved.