Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.threadpool.jmx

public Class ThreadPool

extends JmxObject
Class Inheritance
Annotations
@ManagedObject
@Description:Grizzly ThreadPool (typically shared between Transport instances).
Imports
org.glassfish.grizzly.monitoring.jmx.JmxObject, org.glassfish.grizzly.threadpool.ThreadPoolProbe, .ThreadPoolInfo, org.glassfish.gmbal.Description, .GmbalMBean, .ManagedAttribute, .ManagedObject, java.util.concurrent.atomic.AtomicInteger, .AtomicLong, org.glassfish.grizzly.jmxbase.GrizzlyJmxManager

JMX managed object for Grizzly thread pool implementations.
Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private final ThreadPoolProbe
private final ThreadPoolInfo
private final AtomicInteger
private final AtomicLong
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getBusyThreadCount()

Returns: the number of threads, which are currently busy processing the tasks.

public int
getCorePoolSize()

Returns: the core size of this thread pool.

public int
getCurrentAllocatedThreadCount()

Returns: the current number of threads maintained by this thread pool.

public int
getCurrentTaskCount()

Returns: the current number of tasks that have been queued for processing by this thread pool.

public String
public int
getMaxAllowedThreads()

Returns: the max number of threads allowed by this thread pool.

public String
getPoolType()

Returns: the Java type of the managed thread pool.

public int
getTotalAllocatedThreadCount()

Returns: the total number of threads that have been allocated over time by this thread pool.

public long
getTotalCompletedTasksCount()

Returns: the total number of tasks that have been completed by this thread pool.

public int
getTotalTaskQueueOverflowCount()

Returns: the number of times the task queue has reached it's upper limit.

public boolean
isStarted()

Returns: true if this pool has been started, otherwise return false

protected void
onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

protected void
onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

Field Detail

busyThreadsCountback to summary
private final AtomicInteger busyThreadsCount
probeback to summary
private final ThreadPoolProbe probe
threadPoolback to summary
private final ThreadPoolInfo threadPool
totalAllocatedThreadCountback to summary
private final AtomicInteger totalAllocatedThreadCount
totalCompletedTasksCountback to summary
private final AtomicLong totalCompletedTasksCount
totalTaskQueueOverflowCountback to summary
private final AtomicInteger totalTaskQueueOverflowCount

Constructor Detail

ThreadPoolback to summary
public ThreadPool(ThreadPoolInfo threadPool)

Method Detail

getBusyThreadCountback to summary
public int getBusyThreadCount()
Returns:int

the number of threads, which are currently busy processing the tasks.

Annotations
@ManagedAttribute
id:thread-pool-busy-thread-count
@Description:The number of threads, which are currently busy processing the tasks.
Since
2.3.20
getCorePoolSizeback to summary
public int getCorePoolSize()
Returns:int

the core size of this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-core-pool-size
@Description:The initial/minimum number of threads managed by this thread pool.
getCurrentAllocatedThreadCountback to summary
public int getCurrentAllocatedThreadCount()
Returns:int

the current number of threads maintained by this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-allocated-thread-count
@Description:The current number of threads managed by this thread pool.
getCurrentTaskCountback to summary
public int getCurrentTaskCount()
Returns:int

the current number of tasks that have been queued for processing by this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-queued-task-count
@Description:The number of tasks currently being queued by this thread pool.
getJmxNameback to summary
public String getJmxName()

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.getJmxName.

Annotations
@Override
getMaxAllowedThreadsback to summary
public int getMaxAllowedThreads()
Returns:int

the max number of threads allowed by this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-max-num-threads
@Description:The maximum number of the threads allowed by this thread pool.
getPoolTypeback to summary
public String getPoolType()
Returns:String

the Java type of the managed thread pool.

Annotations
@ManagedAttribute
id:thread-pool-type
@Description:The Java type of the thread pool implementation being used.
getTotalAllocatedThreadCountback to summary
public int getTotalAllocatedThreadCount()
Returns:int

the total number of threads that have been allocated over time by this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-total-allocated-thread-count
@Description:The total number of threads allocated during the lifetime of this thread pool.
getTotalCompletedTasksCountback to summary
public long getTotalCompletedTasksCount()
Returns:long

the total number of tasks that have been completed by this thread pool.

Annotations
@ManagedAttribute
id:thread-pool-total-completed-tasks-count
@Description:The total number of tasks that have been processed by this thread pool.
getTotalTaskQueueOverflowCountback to summary
public int getTotalTaskQueueOverflowCount()
Returns:int

the number of times the task queue has reached it's upper limit.

Annotations
@ManagedAttribute
id:thread-pool-task-queue-overflow-count
@Description:The total number of times the task queue of this thread pool has been saturated.
isStartedback to summary
public boolean isStarted()
Returns:boolean

true if this pool has been started, otherwise return false

Annotations
@ManagedAttribute
id:thread-pool-started
@Description:Indiciates whether or not the thread pool has been started.
onDeregisterback to summary
protected void onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

Annotations
@Override
onRegisterback to summary
protected void onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

Annotations
@Override
org.glassfish.grizzly.threadpool.jmx back to summary

private final Class ThreadPool.JmxThreadPoolProbe

extends Adapter
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public void
public void
public void
onTaskDequeueEvent(ThreadPoolInfo threadPool, Runnable task)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskDequeueEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskDequeueEvent.

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

public void
onTaskQueueOverflowEvent(ThreadPoolInfo threadPool)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskQueueOverflowEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskQueueOverflowEvent.

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

public void
Inherited from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter:
onMaxNumberOfThreadsEventonTaskQueueEventonThreadPoolStartEventonThreadPoolStopEventonThreadReleaseEvent

Constructor Detail

JmxThreadPoolProbeback to summary
private JmxThreadPoolProbe()

Method Detail

decBusyThreadCountback to summary
private void decBusyThreadCount()
onTaskCancelEventback to summary
public void onTaskCancelEvent(ThreadPoolInfo threadPool, Runnable task)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskCancelEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskCancelEvent.

Doc from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskCancelEvent.

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.
Annotations
@Override
onTaskCompleteEventback to summary
public void onTaskCompleteEvent(ThreadPoolInfo threadPool, Runnable task)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskCompleteEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskCompleteEvent.

Doc from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskCompleteEvent.

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

Annotations
@Override
onTaskDequeueEventback to summary
public void onTaskDequeueEvent(ThreadPoolInfo threadPool, Runnable task)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskDequeueEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskDequeueEvent.

Doc from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskDequeueEvent.

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

Annotations
@Override
onTaskQueueOverflowEventback to summary
public void onTaskQueueOverflowEvent(ThreadPoolInfo threadPool)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskQueueOverflowEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onTaskQueueOverflowEvent.

Doc from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onTaskQueueOverflowEvent.

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

Annotations
@Override
onThreadAllocateEventback to summary
public void onThreadAllocateEvent(ThreadPoolInfo threadPool, Thread thread)

Overrides org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onThreadAllocateEvent.

Implements org.glassfish.grizzly.threadpool.ThreadPoolProbe.onThreadAllocateEvent.

Doc from org.glassfish.grizzly.threadpool.ThreadPoolProbe.Adapter.onThreadAllocateEvent.

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

Annotations
@Override