Examples of WeakReference


Examples of java.lang.ref.WeakReference

  // System.err.println("effective level: \"" + getName() + "\" := " + level);

  // Recursively update the level on each of our kids.
  if (kids != null) {
      for (int i = 0; i < kids.size(); i++) {
          WeakReference ref = (WeakReference)kids.get(i);
    Logger kid = (Logger) ref.get();
    if (kid != null) {
        kid.updateEffectiveLevel();
     }
      }
  }
View Full Code Here

Examples of java.lang.ref.WeakReference

       * otherwise, remove the reserved entry.  In all cases, notify
       * all waiters on reserved entries in this cache.
       */
      synchronized (cache) {
    if (proxyClass != null) {
        cache.put(key, new WeakReference(proxyClass));
    } else {
        cache.remove(key);
    }
    cache.notifyAll();
      }
View Full Code Here

Examples of java.lang.ref.WeakReference

        inputContextLock = new Object();

        // Deserialized Windows are not yet visible.
        visible = false;

        weakThis = new WeakReference(this);

        anchor = new Object();
        sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));

        addToWindowList();
View Full Code Here

Examples of java.lang.ref.WeakReference

  Reference ref = null;
  if (obj != null) {
      if (soft) {
    ref = new SoftReference(obj);
      } else {
    ref = new WeakReference(obj);
      }
  }
  return ref;
    }
View Full Code Here

Examples of java.lang.ref.WeakReference

  }
  paramNames = new String[param.length];
  params = new ArrayList(param.length);
  for (int i = 0; i < param.length; i++) {
      paramNames[i] = param[i].getName();
      params.add(new WeakReference(param[i]));
  }
    }
View Full Code Here

Examples of java.lang.ref.WeakReference

    // of loading 2 classes in the same VM with the same name
    // and identityHashCode should be nearly impossible.
      }
      // Note: Use a weak reference to avoid holding on to extra
      // objects and classes after they should be unloaded.
      identitymap.put(identity, new WeakReference(k));
  }
View Full Code Here

Examples of java.lang.ref.WeakReference

        Document doc = node.getOwnerDocument();
        if (doc == null) {
            doc = (Document) node;
        }
        synchronized (doc) {
            WeakReference ref = (WeakReference) xpathSupportMap.get(doc);
            if (ref != null) {
                xps = (XPathSupport) ref.get();
            }
            if (xps == null) {
                try {
                    xps = (XPathSupport) xpathSupportClass.newInstance();
                    xpathSupportMap.put(doc, new WeakReference(xps));
                } catch (Exception e) {
                    logger.error("Error instantiating xpathSupport class", e);
                }               
            }
        }
View Full Code Here

Examples of java.lang.ref.WeakReference

            // 5a. Create a new entry for the field
            col = new LinkedList();
            knownFieldReferences.put( key, col );
          }
          // 6. Add a reference to cls to the entry
          col.add( new WeakReference( cls ) );
        }

        // The lines below will be used for the implementation of
        // Method call join points
        //
View Full Code Here

Examples of java.lang.ref.WeakReference

  /* (non-Javadoc)
   * @see java.util.Set#contains(java.lang.Object)
   */
  public boolean contains(Object o) {
    WeakReference wr = new WeakReference(o);
    return realSet.contains(wr);
  }
View Full Code Here

Examples of java.lang.ref.WeakReference

      private Iterator realIter = realSet.iterator();
      public boolean hasNext() {
        return realIter.hasNext();
      }
      public Object next() {
        WeakReference wr = (WeakReference) realIter.next();
        return wr.get();
      }
      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.