Extension SDK 10.1.2

oracle.ide.util
Class WeakDataReference

java.lang.Object
  extended byjava.lang.ref.Reference
      extended byjava.lang.ref.WeakReference
          extended byoracle.ide.util.WeakDataReference

public class WeakDataReference
extends java.lang.ref.WeakReference

The WeakDataReference class is an implementation of WeakReference with a built in notification mechanism. Upon determining that its data has been garbage collected, the WeakDataReference instance will notify its associated WeakDataHolder that the weakly referenced data has expired (i.e. been garbage collected).

The determination that the data has been garbage collected is governed by the behavior of the garbage collector's cooperation with the WeakDataReference's internal ReferenceQueue. That is to say that WeakDataReference notification to its WeakDataHolder can only occur after the garbage collector gets around to putting the WeakDataReference instance into the shared internal ReferenceQueue. The contents of the internal ReferenceQueue are examined regularly via a shared internal thread.

Notification sent by the WeakDataReference to the WeakDataHolder will occur on the AWT event thread.


Constructor Summary
WeakDataReference(WeakDataHolder holder, java.lang.Object data)
          Constructor.
 
Method Summary
 void clear()
          Clears this reference object.
 
Methods inherited from class java.lang.ref.Reference
enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakDataReference

public WeakDataReference(WeakDataHolder holder,
                         java.lang.Object data)
Constructor.

Parameters:
holder - object to be notified some time after collection of the data.
data - object to be weakly referenced.
Method Detail

clear

public void clear()
Clears this reference object. Invoking this method will not cause this object to be enqueued, will result in the release of the internal reference to the WeakDataHolder, and will not result in notification to the WeakDataHolder upon any possible eventual garbage collection of the data.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.