Class ReferenceCounterUtil
java.lang.Object
org.apache.activemq.artemis.utils.ReferenceCounterUtil
- All Implemented Interfaces:
AutoCloseable,ReferenceCounter
- Direct Known Subclasses:
QueueManagerImpl,TransientQueueManagerImpl
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceCounterUtil(Runnable runnable) ReferenceCounterUtil(Runnable runnable, Executor executor) ReferenceCounterUtil(Executor executor) -
Method Summary
-
Constructor Details
-
ReferenceCounterUtil
public ReferenceCounterUtil() -
ReferenceCounterUtil
-
ReferenceCounterUtil
-
ReferenceCounterUtil
-
-
Method Details
-
setTask
- Specified by:
setTaskin interfaceReferenceCounter
-
getTask
- Specified by:
getTaskin interfaceReferenceCounter
-
increment
public int increment()- Specified by:
incrementin interfaceReferenceCounter
-
decrement
public int decrement()- Specified by:
decrementin interfaceReferenceCounter
-
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:ReferenceCounterSome 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:
checkin interfaceReferenceCounter
-
getCount
public int getCount()- Specified by:
getCountin interfaceReferenceCounter
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-