Package java.lang.ref

Examples of java.lang.ref.ReferenceQueue


     */
    public Range createRange() {

        if (ranges == null) {
            ranges = new LinkedList();
            rangeReferenceQueue = new ReferenceQueue();
        }

        Range range = new RangeImpl(this);

        removeStaleRangeReferences();
View Full Code Here


    public static ReferenceQueue getReferenceQueue() {

        if ( queue == null ) {
            synchronized (CleanerThread.class) {
                queue = new ReferenceQueue();
                thread = new CleanerThread();
            }
        }
        return queue;
    }
View Full Code Here

     * Clears the table.
     */
    public void clear() {
        table = new Entry[INITIAL_CAPACITY];
        count = 0;
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

     * Clears the table.
     */
    public void clear() {
        table = new Entry[INITIAL_CAPACITY];
        count = 0;
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

    public static ReferenceQueue getReferenceQueue() {
        if (queue != null)
            return queue;
       
        queue = new ReferenceQueue();
        thread = new CleanerThread();
        return queue;
    }
View Full Code Here

     * Clears the table.
     */
    public void clear() {
        table = new Entry[INITIAL_CAPACITY];
        count = 0;
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

     * Clears the table.
     */
    public void clear() {
        table = new Entry[INITIAL_CAPACITY];
        count = 0;
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

  /**
   * @tests java.lang.ref.PhantomReference#get()
   */
  public void test_get() {
    ReferenceQueue rq = new ReferenceQueue();
    bool = new Boolean(false);
    PhantomReference pr = new PhantomReference(bool, rq);
    assertNull("Same object returned.", pr.get());
  }
View Full Code Here

  /**
   * @tests java.lang.ref.PhantomReference#PhantomReference(java.lang.Object,
   *        java.lang.ref.ReferenceQueue)
   */
  public void test_ConstructorLjava_lang_ObjectLjava_lang_ref_ReferenceQueue() throws Exception {
    ReferenceQueue rq = new ReferenceQueue();
    bool = new Boolean(true);
                PhantomReference pr = new PhantomReference(bool, rq);
                // Allow the finalizer to run to potentially enqueue
                Thread.sleep(1000);
                assertTrue("Initialization failed.", !pr.isEnqueued());
View Full Code Here

  public void test_Constructor() {
    assertTrue("Used for testing.", true);
  }

  protected void setUp() {
    rq = new ReferenceQueue();
  }
View Full Code Here

TOP

Related Classes of java.lang.ref.ReferenceQueue

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.