org.apache.avalon.excalibur.thread.impl
Class DefaultThreadPool
java.lang.Object
java.lang.ThreadGroup
org.apache.avalon.excalibur.thread.impl.DefaultThreadPool
- All Implemented Interfaces:
- Disposable, LogEnabled, ObjectFactory, ThreadPool
- public class DefaultThreadPool
- extends java.lang.ThreadGroup
- implements ObjectFactory, LogEnabled, Disposable, ThreadPool
This class is the public frontend for the thread pool code.
- Author:
| Fields inherited from class java.lang.ThreadGroup |
|
| Methods inherited from class java.lang.ThreadGroup |
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_pool
private final BasicThreadPool m_pool
-
m_underlyingPool
private SoftResourceLimitingPool m_underlyingPool
-
DefaultThreadPool
public DefaultThreadPool(int capacity)
throws java.lang.Exception
DefaultThreadPool
public DefaultThreadPool(java.lang.String name,
int capacity)
throws java.lang.Exception
DefaultThreadPool
public DefaultThreadPool(java.lang.String name,
int min,
int max)
throws java.lang.Exception
enableLogging
public void enableLogging(Logger logger)
- Description copied from interface:
LogEnabled
-
Provide component with a logger.
-
- Specified by:
enableLogging in interface LogEnabled
-
- Parameters:
logger - the logger. Must not be null.
dispose
public void dispose()
- Description copied from interface:
Disposable
-
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.
-
- Specified by:
dispose in interface Disposable
-
newInstance
public java.lang.Object newInstance()
-
- Specified by:
newInstance in interface ObjectFactory
-
decommission
public void decommission(java.lang.Object object)
-
- Specified by:
decommission in interface ObjectFactory
-
getCreatedClass
public java.lang.Class getCreatedClass()
-
- Specified by:
getCreatedClass in interface ObjectFactory
-
execute
public ThreadControl execute(Executable work)
-
Run work in separate thread. Return a valid ThreadControl to control work thread.
-
-
- Parameters:
work - the work to be executed.
- Returns:
- the ThreadControl
execute
public ThreadControl execute(java.lang.Runnable work)
-
Run work in separate thread. Return a valid ThreadControl to control work thread.
-
- Specified by:
execute in interface ThreadPool
-
- Parameters:
work - the work to be executed.
- Returns:
- the ThreadControl
execute
public ThreadControl execute(Executable work)
-
Run work in separate thread. Return a valid ThreadControl to control work thread.
-
- Specified by:
execute in interface ThreadPool
-
- Parameters:
work - the work to be executed.
- Returns:
- the ThreadControl
Please see keelframework.org for information about new Keel releases.