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 Detail

      • 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