com.sun.grizzly.util
Interface ThreadPoolMonitoringProbe


public interface ThreadPoolMonitoringProbe

Monitoring probe providing callbacks that may be invoked by Grizzly ExtendedThreadPool implementations.

Since:
1.9.19
Author:
gustav trede, Alexey Stashok

Method Summary
 void maxNumberOfThreadsReachedEvent(String threadPoolName, int maxNumberOfThreads)
           This event may be fired when the ExtendedThreadPool implementation has allocated and is managing a number of threads equal to the maximum limit of the pool.
 void onTaskCompletedEvent(Runnable task)
           This event may be fired when a dequeued task has completed processing.
 void onTaskDequeuedEvent(Runnable task)
           This event may be fired when a task has been pulled from the queue and is about to be processed.
 void onTaskQueuedEvent(Runnable task)
           This event may be fired when a task has been queued for processing.
 void onTaskQueueOverflowEvent(String threadPoolName)
           This event may be fired when the task queue of the ExtendedThreadPool implementation has exceeded its configured size.
 void threadAllocatedEvent(String threadPoolName, Thread thread)
           This event may be fired when an ExtendedThreadPool implementation allocates a new managed Thread.
 void threadReleasedEvent(String threadPoolName, Thread thread)
           This event may be fired when a thread will no longer be managed by the ExtendedThreadPool implementation.
 

Method Detail

threadAllocatedEvent

void threadAllocatedEvent(String threadPoolName,
                          Thread thread)

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

Parameters:
threadPoolName - the name of the ExtendedThreadPool being monitored
thread - the thread that has been allocated

threadReleasedEvent

void threadReleasedEvent(String threadPoolName,
                         Thread thread)

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

Parameters:
threadPoolName - the name of the ExtendedThreadPool being monitored
thread - the thread that is no longer being managed by the ExtendedThreadPool

maxNumberOfThreadsReachedEvent

void maxNumberOfThreadsReachedEvent(String threadPoolName,
                                    int maxNumberOfThreads)

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

Parameters:
threadPoolName - the name of the ExtendedThreadPool being monitored
maxNumberOfThreads - the maximum number of threads allowed in the ExtendedThreadPool

onTaskQueuedEvent

void onTaskQueuedEvent(Runnable task)

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

Parameters:
task - a unit of work to be processed

onTaskDequeuedEvent

void onTaskDequeuedEvent(Runnable task)

This event may be fired when a task has been pulled from the queue and is about to be processed.

Parameters:
task - a unit of work that is about to be processed.

onTaskCompletedEvent

void onTaskCompletedEvent(Runnable task)

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

Parameters:
task - the unit of work that has completed processing

onTaskQueueOverflowEvent

void onTaskQueueOverflowEvent(String threadPoolName)

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

Parameters:
threadPoolName - the name of the ExtendedThreadPool being monitored


Copyright © 2012 Oracle Corporation. All Rights Reserved.