JBoss Common Classes 2.2.17.GA

org.jboss.util.threadpool
Interface BasicThreadPoolMBean

All Superinterfaces:
ThreadPoolMBean
All Known Implementing Classes:
BasicThreadPool

public interface BasicThreadPoolMBean
extends ThreadPoolMBean

Management interface for the thread pool.

Version:
$Revision: 2761 $
Author:
Adrian Brock

Method Summary
 BlockingMode getBlockingMode()
           
 ClassLoaderSource getClassLoaderSource()
          Gets the source of the classloader that will be set as the thread context classloader for pool threads.
 long getKeepAliveTime()
          Get the keep alive time
 int getMaximumQueueSize()
          Get the maximum queue size
 int getQueueSize()
          Get the current queue size
 String getThreadGroupName()
          Retrieve the thread group name
 void setBlockingMode(BlockingMode mode)
          Set the behavior of the pool when a task is added and the queue is full.
 void setClassLoaderSource(ClassLoaderSource classLoaderSource)
          Sets the source of the classloader that will be set as the thread context classloader for pool threads.
 void setKeepAliveTime(long time)
          Set the keep alive time
 void setMaximumQueueSize(int size)
          Set the maximum queue size
 void setThreadGroupName(String threadGroupName)
          Set the thread group name
 
Methods inherited from interface org.jboss.util.threadpool.ThreadPoolMBean
getInstance, getMaximumPoolSize, getMinimumPoolSize, getName, getPoolNumber, setMaximumPoolSize, setMinimumPoolSize, setName, stop
 

Method Detail

getQueueSize

int getQueueSize()
Get the current queue size

Returns:
the queue size

getMaximumQueueSize

int getMaximumQueueSize()
Get the maximum queue size

Returns:
the maximum queue size

setMaximumQueueSize

void setMaximumQueueSize(int size)
Set the maximum queue size

Parameters:
size - the new maximum queue size

getBlockingMode

BlockingMode getBlockingMode()
Returns:
the blocking mode

setBlockingMode

void setBlockingMode(BlockingMode mode)
Set the behavior of the pool when a task is added and the queue is full. The mode string indicates one of the following modes: abort - a RuntimeException is thrown run - the calling thread executes the task wait - the calling thread blocks until the queue has room discard - the task is silently discarded without being run discardOldest - check to see if a task is about to complete and enque the new task if possible, else run the task in the calling thread

Parameters:
mode - one of run, wait, discard, discardOldest or abort without regard to case.

getThreadGroupName

String getThreadGroupName()
Retrieve the thread group name

Returns:
the thread group name

setThreadGroupName

void setThreadGroupName(String threadGroupName)
Set the thread group name

Parameters:
threadGroupName - - the thread group name

getKeepAliveTime

long getKeepAliveTime()
Get the keep alive time

Returns:
the keep alive time

setKeepAliveTime

void setKeepAliveTime(long time)
Set the keep alive time

Parameters:
time - the keep alive time

getClassLoaderSource

ClassLoaderSource getClassLoaderSource()
Gets the source of the classloader that will be set as the thread context classloader for pool threads.

Returns:
the ClassLoaderSource. May return null.

setClassLoaderSource

void setClassLoaderSource(ClassLoaderSource classLoaderSource)
Sets the source of the classloader that will be set as the thread context classloader for pool threads. If set, whenever any new pool thread is created, it's context classloader will be set to the loader provided by this source. Further, when any thread is returned to the pool, its context classloader will be reset to the loader provided by this source.

If set to null (the default), the pool will not attempt to manage the context classloader for pool threads; instead a newly created pool thread will inherit its context classloader from whatever thread triggered the addition to the pool. A thread returned to the pool will not have its context classloader changed from whatever it was.

Parameters:
classLoaderSource - the ClassLoaderSource. May be null.

JBoss Common Classes 2.2.17.GA

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.