Interface ThreadPoolProbe

All Known Implementing Classes:
ThreadPoolProbe.Adapter

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

    • onThreadPoolStartEvent

      void onThreadPoolStartEvent(ThreadPoolInfo threadPool)

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

      Parameters:
      threadPool - the ThreadPoolInfo being monitored
    • onThreadPoolStopEvent

      void onThreadPoolStopEvent(ThreadPoolInfo threadPool)

      This event may be fired when an ThreadPoolInfo implementation stops.

      Parameters:
      threadPool - the ThreadPoolInfo being monitored
    • onThreadAllocateEvent

      void onThreadAllocateEvent(ThreadPoolInfo threadPool, Thread thread)

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

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

      void onThreadReleaseEvent(ThreadPoolInfo threadPool, Thread thread)

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

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

      void onMaxNumberOfThreadsEvent(ThreadPoolInfo threadPool, int maxNumberOfThreads)

      This event may be fired when the ThreadPoolInfo implementation has allocated and is managing a number of threads equal to the maximum limit of the pool.

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

      void onTaskQueueEvent(ThreadPoolInfo threadPool, Runnable task)

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

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

      void onTaskDequeueEvent(ThreadPoolInfo 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 ThreadPoolInfo being monitored
      task - a unit of work that is about to be processed.
    • onTaskCancelEvent

      void onTaskCancelEvent(ThreadPoolInfo 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 ThreadPoolInfo being monitored
      task - a unit of work that has been canceled
    • onTaskCompleteEvent

      void onTaskCompleteEvent(ThreadPoolInfo threadPool, Runnable task)

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

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

      void onTaskQueueOverflowEvent(ThreadPoolInfo threadPool)

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

      Parameters:
      threadPool - the ThreadPoolInfo being monitored