Package java.lang.ref

Examples of java.lang.ref.ReferenceQueue$Lock


    private void readObject(ObjectInputStream s)
      throws ClassNotFoundException, IOException {
        s.defaultReadObject();
  marks = new MarkVector();
  search = new MarkData(0);
        queue = new ReferenceQueue();
    }
View Full Code Here


  private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException
  {
    s.defaultReadObject();

    int size = s.readInt();
    queue = new ReferenceQueue();
    directComponentRefs = new IntHashMap((int)(size * 1.25));

    while (--size >= 0)
    {
      int uid = s.readInt();
View Full Code Here

  public WeakCache(Cache delegate) {
    this.delegate = delegate;
    this.numberOfHardLinks = 256;
    this.hardLinksToAvoidGarbageCollection = new LinkedList();
    this.queueOfGarbageCollectedEntries = new ReferenceQueue();
  }
View Full Code Here

  public SoftCache(Cache delegate) {
    this.delegate = delegate;
    this.numberOfHardLinks = 256;
    this.hardLinksToAvoidGarbageCollection = new LinkedList();
    this.queueOfGarbageCollectedEntries = new ReferenceQueue();
  }
View Full Code Here

    }

    final ReferenceQueue refQueue()
    {
        if (_refQueue == null)
            _refQueue = new ReferenceQueue();

        return _refQueue;
    }
View Full Code Here

    }
    public static ReferenceManager createCallBackedManager(ReferenceQueue queue) {
        return new ReferenceManager(queue){
            @Override
            public void removeStallEntries() {
                ReferenceQueue queue = getReferenceQueue();
                for(;;) {
                    java.lang.ref.Reference r = queue.poll();
                    if (r==null) break;
                   
                    if (r instanceof Reference) {
                        Reference ref = (Reference) r;
                        Finalizable holder = ref.getHandler();
View Full Code Here

        private volatile boolean shouldRun = true;
        public ThreadedReferenceManager(ReferenceQueue queue) {
            super(queue);
            thread = new Thread() {
                public void run() {
                    ReferenceQueue queue = getReferenceQueue();
                    java.lang.ref.Reference r=null;
                    while (shouldRun) {
                        try {
                            r = queue.remove(1000);
                        catch (InterruptedException e) {
                            break;
                        }
                        if (r==null) continue;
                       
View Full Code Here

        int cap = p2capacity(initialCapacity);

        table = new Entry[cap];
        threshold = (int)(cap * loadFactor);
       
        queue = new ReferenceQueue();
    }
View Full Code Here

   * is activated.
   * In other words, if {@link #newQueue} returns null, {@link #shallExpunge}
   * always returns true (unless you override it too).
   */
  protected ReferenceQueue newQueue() {
    return new ReferenceQueue();
  }
View Full Code Here

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

TOP

Related Classes of java.lang.ref.ReferenceQueue$Lock

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.