Package org.axonframework.common.util
Class PriorityRunnable
java.lang.Object
org.axonframework.common.util.PriorityRunnable
- All Implemented Interfaces:
Comparable<PriorityTask>,Runnable,PriorityTask
A wrapper class of
) defines the
priority of the task. This task uses the
Runnables that adheres to a priority by implementing PriorityTask. Uses a
combination of priority and index to compare between this and other priority task instances.
A calculator (e.g.
invalid reference
org.axonframework.commandhandling.CommandPriorityCalculator
index to differentiate between tasks with the same priority,
ensuring the insert order is leading in those scenarios.- Since:
- 4.6.0
- Author:
- Stefan Dragisic, Milan Savic, Allard Buijze, Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionPriorityRunnable(Runnable task, long priority, long sequence) Construct a priority task. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.common.util.PriorityTask
compareTo
-
Constructor Details
-
PriorityRunnable
Construct a priority task.- Parameters:
task- TheRunnablethat should be executed with apriority.priority- The priority of thetaskto execute, dedicating the order among tasks.sequence- The sequence of thetaskto execute, dedicating the order among equalprioritytasks.
-
-
Method Details
-
run
public void run() -
priority
public long priority()Description copied from interface:PriorityTaskReturns the priority of this task.- Specified by:
priorityin interfacePriorityTask- Returns:
- The priority of this task.
-
sequence
public long sequence()Description copied from interface:PriorityTaskReturns the sequence of this task.- Specified by:
sequencein interfacePriorityTask- Returns:
- The sequence of this task.
-
equals
-
hashCode
public int hashCode() -
toString
-