public class LoggedThreadPoolExecutor extends ScheduledThreadPoolExecutor
ScheduledThreadPoolExecutor that additionally logs uncaught exceptions
and creates threads named with a given name prefix.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
LoggedThreadPoolExecutor(int corePoolSize,
String name,
Logging log)
Creates a new
ScheduledThreadPoolExecutor with the
given initial parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submitallowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskForclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitawaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedpublic LoggedThreadPoolExecutor(int corePoolSize,
String name,
Logging log)
ScheduledThreadPoolExecutor with the
given initial parameters.corePoolSize - the number of threads to keep in the pool, even
if they are idle, unless allowCoreThreadTimeOut is setname - prefix for thread names.log - to print uncaught exceptions.IllegalArgumentException - if corePoolSize < 0protected void afterExecute(Runnable r, Throwable t)
afterExecute in class ThreadPoolExecutorCopyright © 2002–2025 Devexperts LLC. All rights reserved.