Class OrderedExecutor
- java.lang.Object
-
- org.apache.activemq.artemis.utils.actors.HandlerBase
-
- org.apache.activemq.artemis.utils.actors.ProcessorBase<Runnable>
-
- org.apache.activemq.artemis.utils.actors.OrderedExecutor
-
- All Implemented Interfaces:
Executor,ArtemisExecutor
public class OrderedExecutor extends ProcessorBase<Runnable> implements ArtemisExecutor
An executor that always runs all tasks in order, using a delegate executor to run the tasks.
More specifically, any call B to theexecute(Runnable)method that happens-after another call A to the same method, will result in B's task running after A's.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.utils.actors.ProcessorBase
STATE_FORCED_SHUTDOWN, STATE_NOT_RUNNING, STATE_RUNNING, tasks
-
-
Constructor Summary
Constructors Constructor Description OrderedExecutor(Executor delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoTask(Runnable task)voidexecute(Runnable run)booleanisFair()OrderedExecutorsetFair(boolean fair)If this OrderedExecutor is fair, it will yield for another executors after each task ranStringtoString()-
Methods inherited from class org.apache.activemq.artemis.utils.actors.ProcessorBase
flush, isFlushed, remaining, shutdown, shutdown, shutdownNow, status, task, yield
-
Methods inherited from class org.apache.activemq.artemis.utils.actors.HandlerBase
enter, inHandler, leave
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.utils.actors.ArtemisExecutor
flush, isFlushed, shutdown, shutdownNow, shutdownNow, yield
-
-
-
-
Constructor Detail
-
OrderedExecutor
public OrderedExecutor(Executor delegate)
-
-
Method Detail
-
isFair
public boolean isFair()
- Specified by:
isFairin interfaceArtemisExecutor
-
setFair
public OrderedExecutor setFair(boolean fair)
Description copied from interface:ArtemisExecutorIf this OrderedExecutor is fair, it will yield for another executors after each task ran- Specified by:
setFairin interfaceArtemisExecutor
-
doTask
protected final void doTask(Runnable task)
- Specified by:
doTaskin classProcessorBase<Runnable>
-
-