Package java.lang.ref

Examples of java.lang.ref.Reference.clear()


    }
    List list = (List) entry.getValue();
    for (int i = list.size(); --i >= 0; ) {
        Reference value = (Reference) list.get(i);
        if (contains(clear, value.get())) {
      value.clear();
      value.enqueue();
        }
    }
      }
View Full Code Here


   */
  public void run() {
      try {
    while (true) {
        Reference ref = queue.remove();
        ref.clear();
        synchronized (refs) {
      refs.remove(ref);
      if (refs.isEmpty()) {
          reaper = null;
          return;
View Full Code Here

      } else {
    /*
     * Clear the weak reference used for lookup, so that it will
     * not generate spurious reference queue notifications later.
     */
    lookupKey.clear();
      }

      implRef.addTarget(target);
      return implRef;
  }
View Full Code Here

   *  background thread.
   */
  protected void purge() {
    Reference ref = queue.poll();
    while (ref != null) {
      ref.clear();
      ref = queue.poll();
    }
  }

  /**
 
View Full Code Here

                     * the user to be notified. See GEOT-1138.
                     */
                    sleep(15 * 1000L);
                    break;
                }
                ref.clear();
                // Note: To be usefull, the clear() method must have been overridden in Reference
                //       subclasses. This is what WeakHashSet.Entry and WeakHashMap.Entry do.
            } catch (InterruptedException exception) {
                // Somebody doesn't want to lets us sleep... Go back to work.
            } catch (Exception exception) {
View Full Code Here

    if (this.threadStarted)
      return;
    Reference localReference;
    while ((localReference = this.queue.poll()) != null)
    {
      localReference.clear();
      try
      {
        (($FinalizableReference)localReference).finalizeReferent();
      }
      catch (Throwable localThrowable)
View Full Code Here

    if (this.threadStarted)
      return;
    Reference localReference;
    while ((localReference = this.queue.poll()) != null)
    {
      localReference.clear();
      try
      {
        ((FinalizableReference)localReference).finalizeReferent();
      }
      catch (Throwable localThrowable)
View Full Code Here

    public void run() {     
      while (true) {
        try {
          Reference ref = this.remove();
          if (ref != null) {
            ref.clear();
          }
        } catch (InterruptedException e) {
          break;
          //e.printStackTrace();
        }
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.