Package io.agroal.pool.util
Class PriorityScheduledExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- java.util.concurrent.ScheduledThreadPoolExecutor
-
- io.agroal.pool.util.PriorityScheduledExecutor
-
- All Implemented Interfaces:
Executor,ExecutorService,ScheduledExecutorService
public final class PriorityScheduledExecutor extends ScheduledThreadPoolExecutor
- Author:
- Luis Barreiro
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
-
Constructor Summary
Constructors Constructor Description PriorityScheduledExecutor(int executorSize, String threadPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeExecute(Thread thread, Runnable lowPriorityTask)voidexecuteNow(Runnable priorityTask)<T> Future<T>executeNow(Callable<T> priorityTask)<T> Future<T>executeNow(RunnableFuture<T> priorityFuture)voidshutdown()List<Runnable>shutdownNow()-
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, submit, submit, submit
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
-
-
-
-
Constructor Detail
-
PriorityScheduledExecutor
public PriorityScheduledExecutor(int executorSize, String threadPrefix)
-
-
Method Detail
-
executeNow
public void executeNow(Runnable priorityTask)
-
executeNow
public <T> Future<T> executeNow(RunnableFuture<T> priorityFuture)
-
beforeExecute
protected void beforeExecute(Thread thread, Runnable lowPriorityTask)
- Overrides:
beforeExecutein classThreadPoolExecutor
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceExecutorService- Overrides:
shutdownin classScheduledThreadPoolExecutor
-
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNowin interfaceExecutorService- Overrides:
shutdownNowin classScheduledThreadPoolExecutor
-
-