org.apache.avalon.excalibur.thread.impl
Class DefaultThreadPool
java.lang.Object
|
+--java.lang.ThreadGroup
|
+--org.apache.avalon.excalibur.thread.impl.DefaultThreadPool
- All Implemented Interfaces:
- Component, Disposable, LogEnabled, Loggable, ObjectFactory, ThreadPool, ThreadPool
- public class DefaultThreadPool
- extends ThreadGroup
- implements ObjectFactory, Loggable, LogEnabled, Disposable, ThreadPool
This class is the public frontend for the thread pool code.
- Author:
- Avalon Development Team, Peter Donald
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 |
DefaultThreadPool
public DefaultThreadPool(int capacity)
throws Exception
DefaultThreadPool
public DefaultThreadPool(String name,
int capacity)
throws Exception
DefaultThreadPool
public DefaultThreadPool(String name,
int min,
int max)
throws Exception
setLogger
public void setLogger(Logger logger)
- Specified by:
setLogger
in interface Loggable
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLogging
in interface LogEnabled
dispose
public void dispose()
- Specified by:
dispose
in interface Disposable
newInstance
public Object newInstance()
- Specified by:
newInstance
in interface ObjectFactory
decommission
public void decommission(Object object)
- Specified by:
decommission
in interface ObjectFactory
getCreatedClass
public 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.
- Specified by:
execute
in interface ThreadPool
- Parameters:
work
- the work to be executed.
- Returns:
- the ThreadControl
execute
public ThreadControl execute(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
Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.