Package java.lang.ref

Examples of java.lang.ref.WeakReference


     * <p> The <code>eventManager</code> and <code>properties</code>
     * helper fields are initialized by this constructor; no other
     * non-private fields are set.
     */
    public PlanarImage() {
        this.weakThis = new WeakReference(this);

        // Create an event manager.
        eventManager = new PropertyChangeSupportJAI(this);

        // Copy the properties by reference.
View Full Code Here


        boolean result = false;
        if(sink instanceof PlanarImage) {
      result = sinks.add(((PlanarImage)sink).weakThis);
        } else {
            result = sinks.add(new WeakReference(sink));
        }

        return result;
    }
View Full Code Here

                  int tileX,
                  int tileY,
                  Raster tile,
                  Object tileCacheMetric) {

        this.owner = new WeakReference(owner);
        this.tile  = tile;
        this.tileX = tileX;
        this.tileY = tileY;

        this.tileCacheMetric = tileCacheMetric;  // may be null
View Full Code Here

            setEnabled(undo.isEnabled());
        }
        else {
            setEnabled(false);
        }
        docRef = new WeakReference(doc);
    }
View Full Code Here

                setEnabled(newUndo.isEnabled());
            }
            else {
                setEnabled(false);
            }
            docRef = new WeakReference(newDoc);
        }
    }
View Full Code Here

        }

        if (m_tileReaper != null) {
            // TODO: do we need this?
            synchronized ( this ) {
                WeakReference weakKey = null;

                Set keySet = m_imageMap.keySet();
                Iterator it = keySet.iterator();
                while (it.hasNext()) {
                    WeakReference ref = (WeakReference) it.next();

                    if (ref.get() == owner) {
                        weakKey = ref;
                        break;
                    }
                }

                // weakKey = (WeakReference) m_weakRefMap.get(owner);

                if (weakKey == null) {
                    weakKey = new WeakReference( owner, m_tileReaper.getRefQ() );
                    // m_weakRefMap.put(owner, weakKey);
                }

                Set hashKeys = (HashSet) m_imageMap.get(weakKey);
View Full Code Here

         */
        TileReaper( LCTileCache tileCache ) {
            super("TileReaper");
            setDaemon( true );
            m_refQ = new ReferenceQueue();
            m_tileCacheRef = new WeakReference( tileCache );
        }
View Full Code Here

                  int tileX,
                  int tileY,
                  Raster tile,
                  Object tileCacheMetric) {

        this.owner = new WeakReference(owner);
        this.tile  = tile;
        this.tileX = tileX;
        this.tileY = tileY;

        this.tileCacheMetric = tileCacheMetric;  // may be null
View Full Code Here

     * Notify listeners that the set of Document files associated with the
     * given image File has changed.
     */
    private static void notifyListeners(File imageFile) {
        for (Iterator i=Listeners.iterator(); i.hasNext(); ) {
            WeakReference ref = (WeakReference) i.next();
            DocumentDatabaseListener listener =
                (DocumentDatabaseListener) ref.get();
            if (listener != null) {
                listener.docFilesChanged(imageFile);
            }
            else {
                i.remove();
View Full Code Here

        super(
            new CodeSource(
                RevisionAsJarURL.create(bundle),
                (Certificate[]) certificates),
            null, null, null);
        m_felix = new WeakReference(felix);
        m_bundle = new WeakReference(bundle);
        m_revision = new WeakReference(bundle.adapt(BundleRevisionImpl.class));
        m_hashCode = bundle.hashCode();
        m_toString = "[" + bundle + "]";
    }
View Full Code Here

TOP

Related Classes of java.lang.ref.WeakReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.