Package java.lang.ref

Examples of java.lang.ref.Reference


       
        synchronized (REFERENCE_TO_CONNECTION_SOURCE) {
           
            Iterator referenceIter = REFERENCE_TO_CONNECTION_SOURCE.keySet().iterator();
            while (referenceIter.hasNext()) {
                Reference ref = (Reference) referenceIter.next();
                ConnectionSource source =
                    (ConnectionSource) REFERENCE_TO_CONNECTION_SOURCE.get(ref);
                if (source.connectionPool == connectionPool) {
                    referenceIter.remove();
                    HttpConnection connection = (HttpConnection) ref.get();
                    if (connection != null) {
                        connectionsToClose.add(connection);
                    }
                }
            }
View Full Code Here


            while (!shutdown) {
                try {
                    // remove the next reference and process it, a timeout
                    // is used so that the thread does not block indefinitely
                    // and therefore keep the thread from shutting down
                    Reference ref = REFERENCE_QUEUE.remove(1000);
                    if (ref != null) {
                        handleReference(ref);
                    }
                } catch (InterruptedException e) {
                    LOG.debug("ReferenceQueueThread interrupted", e);
View Full Code Here

                            break;
                        }
                    }
                }
                if (im == null) {
                    Reference ref = (Reference)refStore.get(url);
                    if (ref != null) {
                        im = (ImageLoader) ref.get();
                        if (im == null) {
                            //Remove key if its value has been garbage collected
                            refStore.remove(url);
                        }
                    }
View Full Code Here

    * make sure we've cleaned up our released class references
    */
   private void performMaintenance()
   {
      int count = 0;
      Reference ref = null;
      while((ref = queue.poll()) != null)
      {
         count++;
         MyRef myref = (MyRef) ref;
         clean(myref);
View Full Code Here

    * make sure we've cleaned up our released class references
    */
   private void performMaintenance()
   {
      int count = 0;
      Reference ref = null;
      while((ref = queue.poll()) != null)
      {
         count++;
         MyRef myref = (MyRef) ref;
         clean(myref);
View Full Code Here

    * make sure we've cleaned up our released class references
    */
   private void performMaintenance()
   {
      int count = 0;
      Reference ref = null;
      while((ref = queue.poll()) != null)
      {
         count++;
         MyRef myref = (MyRef) ref;
         clean(myref);
View Full Code Here

      log.debug("putFile: " + file.getName());
    }

    Map files = getOrCreateFilesystemCache(file.getFileSystem());

    Reference ref = createReference(file, refqueue);
    FileSystemAndNameKey key = new FileSystemAndNameKey(file
        .getFileSystem(), file.getName());

    synchronized (files)
    {
View Full Code Here

  {
    Map files = getOrCreateFilesystemCache(filesystem);

    synchronized (files)
    {
      Reference ref = (Reference) files.get(name);
      if (ref == null)
      {
        return null;
      }

      FileObject fo = (FileObject) ref.get();
      if (fo == null)
      {
        removeFile(filesystem, name);
      }
      return fo;
View Full Code Here

    {
      loop: while (!requestEnd && !Thread.currentThread().isInterrupted())
      {
        try
        {
          Reference ref = refqueue.remove(1000);
          if (ref == null)
          {
            continue;
          }
View Full Code Here

            while (!shutdown) {
                try {
                    // remove the next reference and process it, a timeout
                    // is used so that the thread does not block indefinitely
                    // and therefore keep the thread from shutting down
                    Reference ref = REFERENCE_QUEUE.remove(1000);
                    if (ref != null) {
                        handleReference(ref);
                    }
                } catch (InterruptedException e) {
                    LOG.debug("ReferenceQueueThread interrupted", e);
View Full Code Here

TOP

Related Classes of java.lang.ref.Reference

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.