Top Description Inners Fields Constructors Methods
com.sun.webkit

public final Class Disposer

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.lang.ref.ReferenceQueue, .WeakReference, java.util.Arrays, .Collection, .HashSet, .Set, java.util.concurrent.LinkedBlockingQueue

This class is used for registering and disposing the native data associated with java objects. The object can register itself by calling the addRecord method and providing 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
private static class
public static class

Field Summary

Modifier and TypeField and Description
private static final Disposer
private static final ReferenceQueue<T>
private static final Set<Disposer.WeakDisposerRecord>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private synchronized void
add(Object
Object to be registered
target
,
DisposerRecord
the associated DisposerRecord object
rec
)

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

private synchronized void
add(Disposer.WeakDisposerRecord
the WeakDisposerRecord object
rec
)

Performs the actual registration of the WeakDisposerRecord be disposed.

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
addRecord(Disposer.WeakDisposerRecord
the associated DisposerRecord object
rec
)

Registers the WeakDisposerRecord for later disposal.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disposerInstanceback to summary
private static final Disposer disposerInstance
queueback to summary
private static final ReferenceQueue<T> queue
recordsback to summary
private static final Set<Disposer.WeakDisposerRecord> records

Constructor Detail

Disposerback to summary
public Disposer()

Method Detail

addback to summary
private 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

rec:DisposerRecord

the associated DisposerRecord object

See Also
DisposerRecord
addback to summary
private synchronized void add(Disposer.WeakDisposerRecord rec)

Performs the actual registration of the WeakDisposerRecord be disposed.

Parameters
rec:Disposer.WeakDisposerRecord

the WeakDisposerRecord object

See Also
DisposerRecord
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
addRecordback to summary
public static void addRecord(Disposer.WeakDisposerRecord rec)

Registers the WeakDisposerRecord for later disposal.

Parameters
rec:Disposer.WeakDisposerRecord

the associated DisposerRecord object

See Also
DisposerRecord
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
com.sun.webkit back to summary

private final Class Disposer.DisposerRunnable

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final Object
private final LinkedBlockingQueue<Disposer.WeakDisposerRecord>
private boolean
private static final Disposer.DisposerRunnable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private void
private static Disposer.DisposerRunnable
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disposerLockback to summary
private final Object disposerLock
disposerQueueback to summary
private final LinkedBlockingQueue<Disposer.WeakDisposerRecord> disposerQueue
isRunningback to summary
private boolean isRunning
theInstanceback to summary
private static final Disposer.DisposerRunnable theInstance

Constructor Detail

DisposerRunnableback to summary
private DisposerRunnable()

Method Detail

enqueueback to summary
private void enqueue(Disposer.WeakDisposerRecord obj)
enqueueAllback to summary
private void enqueueAll(Collection<Disposer.WeakDisposerRecord> objs)
getInstanceback to summary
private static Disposer.DisposerRunnable getInstance()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
com.sun.webkit back to summary

public Class Disposer.WeakDisposerRecord

extends WeakReference
implements DisposerRecord
Class Inheritance
All Implemented Interfaces
com.sun.webkit.DisposerRecord

Field Summary

Modifier and TypeField and Description
private final DisposerRecord

Constructor Summary

AccessConstructor and Description
protected
private

Method Summary

Modifier and TypeMethod and Description
public void

Field Detail

recordback to summary
private final DisposerRecord record

Constructor Detail

WeakDisposerRecordback to summary
protected WeakDisposerRecord(Object referent)
WeakDisposerRecordback to summary
private WeakDisposerRecord(Object referent, DisposerRecord record)

Method Detail

disposeback to summary
public void dispose()

Implements com.sun.webkit.DisposerRecord.dispose.

Annotations
@Override