| Modifier and Type | Class and Description |
|---|---|
| public static interface | Disposer.
This interface is used to hold the resource to be disposed. |
| public static interface | Disposer.
This is an interface which should be implemented by the classes which use Disposer. |
| Modifier and Type | Field and Description |
|---|---|
| private final LinkedList | |
| private static Disposer | |
| private static final int | |
| private final ReferenceQueue | |
| private final Hashtable | |
| private static int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | |
| public static void | |
| private synchronized void | |
| public static void | |
| public static void | disposeRecord(Disposer.
the DisposerRecord object to be disposed recAdd the object to the disposal queue. |
| private synchronized void | disposeUnreachables()
Polls the reference queue to see if there are any unreachable objects to be disposed. |
| private synchronized void |
| disposalQueue | back to summary |
|---|---|
| private final LinkedList<Disposer. | |
| disposerInstance | back to summary |
|---|---|
| private static Disposer disposerInstance | |
| PHANTOM | back to summary |
|---|---|
| private static final int PHANTOM | |
| queue | back to summary |
|---|---|
| private final ReferenceQueue<T> queue | |
| records | back to summary |
|---|---|
| private final Hashtable<K, V> records | |
| refType | back to summary |
|---|---|
| private static int refType | |
| SOFT | back to summary |
|---|---|
| private static final int SOFT | |
| WEAK | back to summary |
|---|---|
| private static final int WEAK | |
| Disposer | back to summary |
|---|---|
| private Disposer() Private constructor to prevent outside instantiation. | |
| add | back to summary |
|---|---|
| private synchronized void add(Object target, Disposer. Performs the actual registration of the target object to be disposed.
| |
| addRecord | back to summary |
|---|---|
| public static void addRecord(Object target, Disposer. Registers the target object and the native data for later disposal when the target is unreachable. .
| |
| addToDisposalQueue | back to summary |
|---|---|
| private synchronized void addToDisposalQueue(Disposer. | |
| cleanUp | back to summary |
|---|---|
| public static void cleanUp() Disposes all unreachable objects and all objects in the disposal queue. It first polls the reference queue, calling the dispose method of each unreachable object. It then iterates the list of objects in the disposal queue, calling the dispose method of each object. Note This method must only be called from the Render Thread (the thread on which the resources were created). | |
| disposeRecord | back to summary |
|---|---|
| public static void disposeRecord(Disposer. Add the object to the disposal queue. The object will be disposed the next time cleanup is called. | |
| disposeUnreachables | back to summary |
|---|---|
| private synchronized void disposeUnreachables() Polls the reference queue to see if there are any unreachable objects to be disposed. If there is work to be done, this method disposes all unreachable objects in the queue, otherwise it returns immediately. | |
| processDisposalQueue | back to summary |
|---|---|
| private synchronized void processDisposalQueue() | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| dispose | back to summary |
|---|---|
| public void dispose() | |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| getDisposerReferent | back to summary |
|---|---|
| public Object getDisposerReferent() Returns an object which will be used as the referent in the ReferenceQueue. | |