Interface ThreadPoolProbe

All Known Implementing Classes:
ThreadPoolProbe.Adapter

public interface ThreadPoolProbe
Monitoring probe providing callbacks that may be invoked by Grizzly AbstractThreadPool implementations.
Since:
1.9.19
Author:
gustav trede, Alexey Stashok
  • Method Details

    • onThreadPoolStartEvent

      void onThreadPoolStartEvent(AbstractThreadPool threadPool)

      This event may be fired when an AbstractThreadPool implementation starts running.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
    • onThreadPoolStopEvent

      void onThreadPoolStopEvent(AbstractThreadPool threadPool)

      This event may be fired when an AbstractThreadPool implementation stops.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
    • onThreadAllocateEvent

      void onThreadAllocateEvent(AbstractThreadPool threadPool, Thread thread)

      This event may be fired when an AbstractThreadPool implementation allocates a new managed Thread.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      thread - the thread that has been allocated
    • onThreadReleaseEvent

      void onThreadReleaseEvent(AbstractThreadPool threadPool, Thread thread)

      This event may be fired when a thread will no longer be managed by the AbstractThreadPool implementation.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      thread - the thread that is no longer being managed by the AbstractThreadPool
    • onMaxNumberOfThreadsEvent

      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.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      maxNumberOfThreads - the maximum number of threads allowed in the AbstractThreadPool
    • onTaskQueueEvent

      void onTaskQueueEvent(AbstractThreadPool threadPool, Runnable task)

      This event may be fired when a task has been queued for processing.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      task - a unit of work to be processed
    • onTaskDequeueEvent

      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.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      task - a unit of work that is about to be processed.
    • onTaskCancelEvent

      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.
      Parameters:
      threadPool - the AbstractThreadPool being monitored
      task - a unit of work that has been canceled
    • onTaskCompleteEvent

      void onTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task)

      This event may be fired when a dequeued task has completed processing.

      Parameters:
      threadPool - the AbstractThreadPool being monitored
      task - the unit of work that has completed processing
    • onTaskQueueOverflowEvent

      void onTaskQueueOverflowEvent(AbstractThreadPool threadPool)

      This event may be fired when the task queue of the AbstractThreadPool implementation has exceeded its configured size.

      Parameters:
      threadPool - the AbstractThreadPool being monitored