org.glassfish.grizzly.threadpool
Interface ThreadPoolProbe


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 Summary
 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.
 void onTaskCompleteEvent(AbstractThreadPool threadPool, java.lang.Runnable task)
           This event may be fired when a dequeued task has completed processing.
 void onTaskDequeueEvent(AbstractThreadPool threadPool, java.lang.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, java.lang.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 the AbstractThreadPool implementation has exceeded its configured size.
 void onThreadAllocateEvent(AbstractThreadPool threadPool, java.lang.Thread thread)
           This event may be fired when an AbstractThreadPool implementation allocates a new managed Thread.
 void onThreadPoolStartEvent(AbstractThreadPool threadPool)
           This event may be fired when an AbstractThreadPool implementation starts running.
 void onThreadPoolStopEvent(AbstractThreadPool threadPool)
           This event may be fired when an AbstractThreadPool implementation stops.
 void onThreadReleaseEvent(AbstractThreadPool threadPool, java.lang.Thread thread)
           This event may be fired when a thread will no longer be managed by the AbstractThreadPool implementation.
 

Method Detail

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,
                           java.lang.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,
                          java.lang.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,
                      java.lang.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,
                        java.lang.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.

onTaskCompleteEvent

void onTaskCompleteEvent(AbstractThreadPool threadPool,
                         java.lang.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


Copyright © 2011 Oracle Corpration. All Rights Reserved.