Class ReferenceCounterUtil

  • All Implemented Interfaces:
    java.lang.AutoCloseable, ReferenceCounter

    public class ReferenceCounterUtil
    extends java.lang.Object
    implements ReferenceCounter, java.lang.AutoCloseable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void check()
      Some asynchronous operations (like ack) may delay certain conditions.
      void close()  
      int decrement()  
      void exhaust()
      it will set the value all the way to 0, and execute the task meant for when the value was 0.
      int getCount()  
      java.lang.Runnable getTask()  
      int increment()  
      void setTask​(java.lang.Runnable task)  
      • Methods inherited from class java.lang.Object

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

      • ReferenceCounterUtil

        public ReferenceCounterUtil()
      • ReferenceCounterUtil

        public ReferenceCounterUtil​(java.util.concurrent.Executor executor)
      • ReferenceCounterUtil

        public ReferenceCounterUtil​(java.lang.Runnable runnable,
                                    java.util.concurrent.Executor executor)
      • ReferenceCounterUtil

        public ReferenceCounterUtil​(java.lang.Runnable runnable)
    • Method Detail

      • exhaust

        public void exhaust()
        it will set the value all the way to 0, and execute the task meant for when the value was 0.
      • check

        public void check()
        Description copied from interface: ReferenceCounter
        Some asynchronous operations (like ack) may delay certain conditions. After met, during afterCompletion we may need to recheck certain values to make sure we won't get into a situation where the condition was met asynchronously and queues not removed.
        Specified by:
        check in interface ReferenceCounter
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable