- All Known Implementing Classes:
ThreadPoolProbe.Adapter
AbstractThreadPool implementations.- Since:
- 1.9.19
- Author:
- gustav trede, Alexey Stashok
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThreadPoolProbeadapter that provides no-op implementations for all interface methods allowing easy extension by the developer. -
Method Summary
Modifier and TypeMethodDescriptionvoidonMaxNumberOfThreadsEvent(AbstractThreadPool threadPool, int maxNumberOfThreads) This event may be fired when theAbstractThreadPoolimplementation has allocated and is managing a number of threads equal to the maximum limit of the pool.voidonTaskCancelEvent(AbstractThreadPool threadPool, Runnable task) This event may be fired when a dequeued task has been canceled.voidonTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task) This event may be fired when a dequeued task has completed processing.voidonTaskDequeueEvent(AbstractThreadPool threadPool, Runnable task) This event may be fired when a task has been pulled from the queue and is about to be processed.voidonTaskQueueEvent(AbstractThreadPool threadPool, Runnable task) This event may be fired when a task has been queued for processing.voidonTaskQueueOverflowEvent(AbstractThreadPool threadPool) This event may be fired when the task queue of theAbstractThreadPoolimplementation has exceeded its configured size.voidonThreadAllocateEvent(AbstractThreadPool threadPool, Thread thread) This event may be fired when anAbstractThreadPoolimplementation allocates a new managedThread.voidonThreadPoolStartEvent(AbstractThreadPool threadPool) This event may be fired when anAbstractThreadPoolimplementation starts running.voidonThreadPoolStopEvent(AbstractThreadPool threadPool) This event may be fired when anAbstractThreadPoolimplementation stops.voidonThreadReleaseEvent(AbstractThreadPool threadPool, Thread thread) This event may be fired when a thread will no longer be managed by theAbstractThreadPoolimplementation.
-
Method Details
-
onThreadPoolStartEvent
This event may be fired when an
AbstractThreadPoolimplementation starts running.- Parameters:
threadPool- theAbstractThreadPoolbeing monitored
-
onThreadPoolStopEvent
This event may be fired when an
AbstractThreadPoolimplementation stops.- Parameters:
threadPool- theAbstractThreadPoolbeing monitored
-
onThreadAllocateEvent
This event may be fired when an
AbstractThreadPoolimplementation allocates a new managedThread.- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredthread- the thread that has been allocated
-
onThreadReleaseEvent
This event may be fired when a thread will no longer be managed by the
AbstractThreadPoolimplementation.- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredthread- the thread that is no longer being managed by theAbstractThreadPool
-
onMaxNumberOfThreadsEvent
This event may be fired when the
AbstractThreadPoolimplementation has allocated and is managing a number of threads equal to the maximum limit of the pool.- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredmaxNumberOfThreads- the maximum number of threads allowed in theAbstractThreadPool
-
onTaskQueueEvent
This event may be fired when a task has been queued for processing.
- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredtask- a unit of work to be processed
-
onTaskDequeueEvent
This event may be fired when a task has been pulled from the queue and is about to be processed.
- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredtask- a unit of work that is about to be processed.
-
onTaskCancelEvent
This event may be fired when a dequeued task has been canceled.
This event can occur during shutdownNow() invocation, where tasks are getting pulled out of thread pool queue and returned as the result of shutdownNow() method call.- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredtask- a unit of work that has been canceled
-
onTaskCompleteEvent
This event may be fired when a dequeued task has completed processing.
- Parameters:
threadPool- theAbstractThreadPoolbeing monitoredtask- the unit of work that has completed processing
-
onTaskQueueOverflowEvent
This event may be fired when the task queue of the
AbstractThreadPoolimplementation has exceeded its configured size.- Parameters:
threadPool- theAbstractThreadPoolbeing monitored
-