Package 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$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BlockingMode
getBlockingMode()
ClassLoaderSource
getClassLoaderSource()
Gets the source of the classloader that will be set as thethread context classloader
for pool threads.long
getKeepAliveTime()
Get the keep alive timeint
getMaximumQueueSize()
Get the maximum queue sizeint
getQueueSize()
Get the current queue sizejava.lang.String
getThreadGroupName()
Retrieve the thread group namevoid
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 thethread context classloader
for pool threads.void
setKeepAliveTime(long time)
Set the keep alive timevoid
setMaximumQueueSize(int size)
Set the maximum queue sizevoid
setThreadGroupName(java.lang.String threadGroupName)
Set the thread group name-
Methods inherited from interface org.jboss.util.threadpool.ThreadPoolMBean
getInstance, getMaximumPoolSize, getMinimumPoolSize, getName, getPoolNumber, getPoolSize, 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
java.lang.String getThreadGroupName()
Retrieve the thread group name- Returns:
- the thread group name
-
setThreadGroupName
void setThreadGroupName(java.lang.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 thethread context classloader
for pool threads.- Returns:
- the
ClassLoaderSource
. May returnnull
.
-
setClassLoaderSource
void setClassLoaderSource(ClassLoaderSource classLoaderSource)
Sets the source of the classloader that will be set as thethread 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
- theClassLoaderSource
. May benull
.
-
-