Class ActiveObjectCounter<T>

  • Type Parameters:
    T - the object type.

    public class ActiveObjectCounter<T>
    extends java.lang.Object
    A mechanism to keep track of active objects.
    Author:
    Dave Syer, Artem Bilan
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T object)  
      boolean await​(long timeout, java.util.concurrent.TimeUnit timeUnit)  
      void deactivate()  
      int getCount()  
      boolean isActive()  
      void release​(T object)  
      void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ActiveObjectCounter

        public ActiveObjectCounter()
    • Method Detail

      • add

        public void add​(T object)
      • release

        public void release​(T object)
      • await

        public boolean await​(long timeout,
                             java.util.concurrent.TimeUnit timeUnit)
                      throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • getCount

        public int getCount()
      • reset

        public void reset()
      • deactivate

        public void deactivate()
      • isActive

        public boolean isActive()