Examples of ReferenceQueue


Examples of java.lang.ref.ReferenceQueue

     *
     * @param obj the object on which to wait
     */
    public WaitUnreachable(Object obj) {
        this.obj = obj;
        queue = new ReferenceQueue();
        ref = new PhantomReference(obj, queue);
    }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

     * No-args constructor
     */
    public MultiThreadedHttpConnectionManager() {

        this.referenceToHostConfig = Collections.synchronizedMap( new HashMap() );
        this.referenceQueue = new ReferenceQueue();

        new ReferenceQueueThread().start();

    }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

    /**
     * Initialise this subclass during construction, cloning or deserialization.
     */
    protected void init() {
        queue = new ReferenceQueue();
    }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

     */
    private void readObject(ObjectInputStream inp) throws IOException, ClassNotFoundException {
        inp.defaultReadObject();
        table = new Entry[inp.readInt()];
        threshold = (int)(table.length * loadFactor);
        queue = new ReferenceQueue();
        Object key = inp.readObject();
        while (key != null) {
            Object value = inp.readObject();
            put(key, value);
            key = inp.readObject();
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

            capacity <<= 1;
        }
        this.loadFactor = loadFactor;
        threshold = (int)(capacity * loadFactor);
        entries = new WeakEntry[capacity];
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

     */
    public IdentityWeakHashMap() {
        loadFactor = DEFAULT_LOAD_FACTOR;
        threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);
        entries = new WeakEntry[DEFAULT_INITIAL_CAPACITY];
        referenceQueue = new ReferenceQueue();
    }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

     */
    public Object clone() {
        try {
            WeakEntry[] copyOfEntries = entries;
            IdentityWeakHashMap clone = (IdentityWeakHashMap)super.clone();
            clone.referenceQueue = new ReferenceQueue();
            clone.entries = new WeakEntry[copyOfEntries.length];
            for (int i = copyOfEntries.length; i-- > 0;) {
                clone.entries[i] = (copyOfEntries[i] != null) ? (WeakEntry)copyOfEntries[i].clone(clone.referenceQueue) : null;
            }
            clone.keySet = null;
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

  }

  private void init() {
    this.strongRefCache = new LRUMap( strongRefCount );
    this.softRefCache = new LRUMap( softRefCount );
    this.referenceQueue = new ReferenceQueue();
  }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

  }

  private void init() {
    this.strongRefCache = new LRUMap( strongRefCount );
    this.softRefCache = new LRUMap( softRefCount );
    this.referenceQueue = new ReferenceQueue();
  }
View Full Code Here

Examples of java.lang.ref.ReferenceQueue

  }

  private void init() {
    this.strongRefCache = new LRUMap( strongRefCount );
    this.softRefCache = new LRUMap( softRefCount );
    this.referenceQueue = new ReferenceQueue();
  }
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.