Class ReferenceCounterUtil
- java.lang.Object
-
- org.apache.activemq.artemis.utils.ReferenceCounterUtil
-
- All Implemented Interfaces:
AutoCloseable
,ReferenceCounter
public class ReferenceCounterUtil extends Object implements ReferenceCounter, AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description ReferenceCounterUtil()
ReferenceCounterUtil(Runnable runnable)
ReferenceCounterUtil(Runnable runnable, Executor executor)
ReferenceCounterUtil(Executor executor)
-
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()
Runnable
getTask()
int
increment()
void
setTask(Runnable task)
-
-
-
Method Detail
-
setTask
public void setTask(Runnable task)
- Specified by:
setTask
in interfaceReferenceCounter
-
getTask
public Runnable getTask()
- Specified by:
getTask
in interfaceReferenceCounter
-
increment
public int increment()
- Specified by:
increment
in interfaceReferenceCounter
-
decrement
public int decrement()
- Specified by:
decrement
in 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: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 interfaceReferenceCounter
-
getCount
public int getCount()
- Specified by:
getCount
in interfaceReferenceCounter
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-