Package java.lang.ref

Examples of java.lang.ref.Reference


    reqRefQueue = new ReferenceQueue ();
    reqRefCleaner = new Thread () {
      public void run () {
          while (true) {
        try {
            Reference ref = reqRefQueue.remove ();
            synchronized
          (StandardWorkflowService.this) {
          Set procKeys
              = (Set)procKeysByReq.remove (ref);
          for (Iterator i = procKeys.iterator ();
View Full Code Here


         {
            BigInteger bi = new BigInteger(16384, rnd);
            list.add(bi);
            if (i%1000==0)
            {
               Reference ref;
               if ( (ref = queue.poll()) != null)
               {
                  System.out.println("Break as the soft reference has been queued: "+ref);
                  break;
               }
View Full Code Here

   
    /**
     * Removes stale entries from the pool.
     */
    private void clean() {
        Reference ref = fReferenceQueue.poll();
        while (ref != null) {
            Entry entry = ((SoftGrammarReference) ref).entry;
            if (entry != null) {
                removeEntry(entry);
            }
View Full Code Here

    {

      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
          Reference ref = REFERENCE_QUEUE.remove();
          if( ref != null )
          {
            handleReference( ref );
          }
        }
View Full Code Here

    /**
     * Removes stale entries from the pool.
     */
    private void clean() {
        Reference ref = fReferenceQueue.poll();
        while (ref != null) {
            Entry entry = ((SoftGrammarReference) ref).entry;
            if (entry != null) {
                removeEntry(entry);
            }
View Full Code Here

  /**
   * Cleanup the cache. Every garbage collected item must be removed
   */
  public void cleanUp(){
    Reference ref = mRefQueue.poll();
    while (ref != null) {
      ref = mRefQueue.poll();
      mRefHashMap.remove(ref);
      if (ref != null) {
        T key = mRefHashMap.get(ref);
View Full Code Here

   */
  static CachedIntrospectionResults forClass(Class beanClass) throws BeansException {
    CachedIntrospectionResults results = null;
    Object value = classCache.get(beanClass);
    if (value instanceof Reference) {
      Reference ref = (Reference) value;
      results = (CachedIntrospectionResults) ref.get();
    }
    else {
      results = (CachedIntrospectionResults) value;
    }
    if (results == null) {
View Full Code Here

    Object value;
    synchronized (classCache) {
      value = classCache.get(beanClass);
    }
    if (value instanceof Reference) {
      Reference ref = (Reference) value;
      results = (CachedIntrospectionResults) ref.get();
    }
    else {
      results = (CachedIntrospectionResults) value;
    }
    if (results == null) {
View Full Code Here

    public void run() {
      logger.debug("Starting reference monitor thread");
      // Check if there are any tracked entries left.
      while (keepMonitoringThreadAlive()) {
        try {
          Reference reference = handleQueue.remove();
          // Stop tracking this reference.
          ReleaseListener entry = removeEntry(reference);
          if (entry != null) {
            // Invoke listener callback.
            try {
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.