APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.java2d

public Class Disposer

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Annotations
@SuppressWarnings:restricted
Imports
java.lang.ref.PhantomReference, .Reference, .ReferenceQueue, .WeakReference, java.util.Hashtable, java.util.concurrent.ConcurrentLinkedDeque, sun.awt.util.ThreadGroupUtils

This class is used for registering and disposing the native data associated with java objects. The object can register itself by calling one of the addRecord methods and providing either the pointer to the native disposal method or a descendant of the DisposerRecord class with overridden dispose() method. When the object becomes unreachable, the dispose() method of the associated DisposerRecord object will be called.
See Also
DisposerRecord

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private static ConcurrentLinkedDeque<DisposerRecord>
private static final Disposer
public static volatile boolean
private static final ReferenceQueue<Object>
private static final Hashtable<Reference<Object>, DisposerRecord>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
add(Object
Object to be registered, or if target is an instance of DisposerTarget, its associated disposer referent will be the Object that is registered
target
,
DisposerRecord
the associated DisposerRecord object
rec
)

Performs the actual registration of the target object to be disposed.

public static void
public static void
addRecord(Object
Object to be registered
target
,
long
pointer to the native disposal method
disposeMethod
,
long
pointer to the data to be passed to the native disposal method
pData
)

Registers the object and the native data for later disposal.

public static void
addRecord(Object
Object to be registered
target
,
DisposerRecord
the associated DisposerRecord object
rec
)

Registers the object and the native data for later disposal.

public static void
private static void
public static ReferenceQueue<Object>
private static native void
public static void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deferredRecordsback to summary
private static ConcurrentLinkedDeque<DisposerRecord> deferredRecords
disposerInstanceback to summary
private static final Disposer disposerInstance
pollingQueueback to summary
public static volatile boolean pollingQueue
queueback to summary
private static final ReferenceQueue<Object> queue
recordsback to summary
private static final Hashtable<Reference<Object>, DisposerRecord> records

Constructor Detail

Disposerback to summary
public Disposer()

Method Detail

addback to summary
pack-priv synchronized void add(Object target, DisposerRecord rec)

Performs the actual registration of the target object to be disposed.

Parameters
target:Object

Object to be registered, or if target is an instance of DisposerTarget, its associated disposer referent will be the Object that is registered

rec:DisposerRecord

the associated DisposerRecord object

See Also
DisposerRecord
addObjectRecordback to summary
public static void addObjectRecord(Object obj, DisposerRecord rec)
addRecordback to summary
public static void addRecord(Object target, long disposeMethod, long pData)

Registers the object and the native data for later disposal.

Parameters
target:Object

Object to be registered

disposeMethod:long

pointer to the native disposal method

pData:long

pointer to the data to be passed to the native disposal method

addRecordback to summary
public static void addRecord(Object target, DisposerRecord rec)

Registers the object and the native data for later disposal.

Parameters
target:Object

Object to be registered

rec:DisposerRecord

the associated DisposerRecord object

See Also
DisposerRecord
addReferenceback to summary
public static void addReference(Reference<Object> ref, DisposerRecord rec)
clearDeferredRecordsback to summary
private static void clearDeferredRecords()
getQueueback to summary
public static ReferenceQueue<Object> getQueue()
initIDsback to summary
private static native void initIDs()
pollRemoveback to summary
public static void pollRemove()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

safeDisposeback to summary
private static void safeDispose(DisposerRecord rec)
sun.java2d back to summary

public Interface Disposer.PollDisposable

Known Direct Implementers
sun.font.FontDesignMetrics.KeyReference, sun.font.FontStrikeDisposer