Class ThreadPoolProbe.Adapter
- java.lang.Object
-
- org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter
-
- All Implemented Interfaces:
ThreadPoolProbe
- Enclosing interface:
- ThreadPoolProbe
public static class ThreadPoolProbe.Adapter extends Object implements ThreadPoolProbe
ThreadPoolProbe
adapter that provides no-op implementations for all interface methods allowing easy extension by the developer.- Since:
- 2.1.9
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.grizzly.threadpool.ThreadPoolProbe
ThreadPoolProbe.Adapter
-
-
Constructor Summary
Constructors Constructor Description Adapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onMaxNumberOfThreadsEvent(AbstractThreadPool threadPool, int maxNumberOfThreads)
This event may be fired when theAbstractThreadPool
implementation has allocated and is managing a number of threads equal to the maximum limit of the pool.void
onTaskCancelEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a dequeued task has been canceled.void
onTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a dequeued task has completed processing.void
onTaskDequeueEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a task has been pulled from the queue and is about to be processed.void
onTaskQueueEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a task has been queued for processing.void
onTaskQueueOverflowEvent(AbstractThreadPool threadPool)
This event may be fired when the task queue of theAbstractThreadPool
implementation has exceeded its configured size.void
onThreadAllocateEvent(AbstractThreadPool threadPool, Thread thread)
This event may be fired when anAbstractThreadPool
implementation allocates a new managedThread
.void
onThreadPoolStartEvent(AbstractThreadPool threadPool)
This event may be fired when anAbstractThreadPool
implementation starts running.void
onThreadPoolStopEvent(AbstractThreadPool threadPool)
This event may be fired when anAbstractThreadPool
implementation stops.void
onThreadReleaseEvent(AbstractThreadPool threadPool, Thread thread)
This event may be fired when a thread will no longer be managed by theAbstractThreadPool
implementation.
-
-
-
Method Detail
-
onThreadPoolStartEvent
public void onThreadPoolStartEvent(AbstractThreadPool threadPool)
This event may be fired when an
AbstractThreadPool
implementation starts running.- Specified by:
onThreadPoolStartEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitored
-
onThreadPoolStopEvent
public void onThreadPoolStopEvent(AbstractThreadPool threadPool)
This event may be fired when an
AbstractThreadPool
implementation stops.- Specified by:
onThreadPoolStopEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitored
-
onThreadAllocateEvent
public void onThreadAllocateEvent(AbstractThreadPool threadPool, Thread thread)
This event may be fired when an
AbstractThreadPool
implementation allocates a new managedThread
.- Specified by:
onThreadAllocateEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredthread
- the thread that has been allocated
-
onThreadReleaseEvent
public void onThreadReleaseEvent(AbstractThreadPool threadPool, Thread thread)
This event may be fired when a thread will no longer be managed by the
AbstractThreadPool
implementation.- Specified by:
onThreadReleaseEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredthread
- the thread that is no longer being managed by theAbstractThreadPool
-
onMaxNumberOfThreadsEvent
public void onMaxNumberOfThreadsEvent(AbstractThreadPool threadPool, int maxNumberOfThreads)
This event may be fired when the
AbstractThreadPool
implementation has allocated and is managing a number of threads equal to the maximum limit of the pool.- Specified by:
onMaxNumberOfThreadsEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredmaxNumberOfThreads
- the maximum number of threads allowed in theAbstractThreadPool
-
onTaskQueueEvent
public void onTaskQueueEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a task has been queued for processing.
- Specified by:
onTaskQueueEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredtask
- a unit of work to be processed
-
onTaskDequeueEvent
public void onTaskDequeueEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a task has been pulled from the queue and is about to be processed.
- Specified by:
onTaskDequeueEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredtask
- a unit of work that is about to be processed.
-
onTaskCancelEvent
public void onTaskCancelEvent(AbstractThreadPool threadPool, Runnable task)
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.- Specified by:
onTaskCancelEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredtask
- a unit of work that has been canceled
-
onTaskCompleteEvent
public void onTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task)
This event may be fired when a dequeued task has completed processing.
- Specified by:
onTaskCompleteEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitoredtask
- the unit of work that has completed processing
-
onTaskQueueOverflowEvent
public void onTaskQueueOverflowEvent(AbstractThreadPool threadPool)
This event may be fired when the task queue of the
AbstractThreadPool
implementation has exceeded its configured size.- Specified by:
onTaskQueueOverflowEvent
in interfaceThreadPoolProbe
- Parameters:
threadPool
- theAbstractThreadPool
being monitored
-
-