Class PriorityExecutorService

java.lang.Object
org.axonframework.axonserver.connector.util.PriorityExecutorService
All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService

public class PriorityExecutorService extends Object implements ExecutorService
This ExecutorService wraps an existing one, creating a PriorityTask for every Runnable that is submitted that's an instance of one. The created PriorityTask will have the priority provided in the constructor, as well as the taskSequence provided there.

This implementation also diverts all invocations of ExecutorService.submit(Runnable) to Executor.execute(Runnable) instead. This is because the submit method implementations wrap the tasks in another FutureTask, which makes the task uncomparable again.

Since:
4.6.0
Author:
Mitchell Herrijgers, Milan Savic