Package com.sun.enterprise.util.collection

Examples of com.sun.enterprise.util.collection.FastStack


      
      long now = _clock.getTime();
      long allowed = now - maxIdleTime;
      
       TimeStampedSoftDListNode tsNode = null;
       FastStack stack = new FastStack();
      
       synchronized (super.collection) {

         Object done = null;
         while (done == null) {
           tsNode = (TimeStampedSoftDListNode) list.getFirstDListNode();
          
           if (tsNode == null) {  //Empty list
             done = new Object();
           } else if (tsNode.timeStamp <= allowed) {
            //Need to destroy the contained object
            list.delink(tsNode);
            stack.push(tsNode.object);
            killedCount++;
          } else {
            //This node is not old enough
             done = new Object();
          }
        }  //End of for loop
       
        super.createdCount -= killedCount;
       
        int deficit = list.size() - minSize;
        super.preload(0 - deficit);
       
        if (killedCount == 0) {
        } else if (killedCount == 1) {
          collection.notify();
        } else {
          collection.notifyAll();
        }
       
      } // end of synchronized
     
     
      //Now destroy all collected objects
      while (! stack.isEmpty()) {
        Object object = stack.pop();
      beforeDestroy(object);
         factory.destroy(object);
      }
     
//Bug 4677074      System.out.println("Leaving service after killing " + killedCount + " (idle) objects. Now size: " + list.size());
View Full Code Here


      
      long now = _clock.getTime();
      long allowed = now - maxIdleTime;
      
       TimeStampedDListNode tsNode = null;
       FastStack stack = new FastStack();
      
       synchronized (super.collection) {
         Object done = null;
         while (done == null) {
           tsNode = (TimeStampedDListNode) list.getFirstDListNode();
          
           if (tsNode == null) {  //Empty list
             done = new Object();
           } else if (tsNode.timeStamp <= allowed) {
            //Need to destroy the contained object
            list.delink(tsNode);
            stack.push(tsNode.object);
            killedCount++;
          } else {
            //This node is not old enough
             done = new Object();
          }
        }  //End of for loop
       
        super.createdCount -= killedCount;
       
        if (createdCount < minSize) {
          super.preload(minSize - createdCount);
        }
       
        if (waitCount > 0) {
          if (killedCount == 1) {
            collection.notify();
          } else {
            collection.notifyAll();
          }
        }
       
      } // end of synchronized
     
     
      //Now destroy all collected objects
      while (! stack.isEmpty()) {
        Object object = stack.pop();
      beforeDestroy(object);
         factory.destroy(object);
      }
     
//Bug 4677074      System.out.println("Leaving service after killing " + killedCount + " (idle) objects. Now size: " + list.size());
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.collection.FastStack

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.