org.apache.avalon.excalibur.thread.impl
Class DefaultThreadPool
java.lang.Object
java.lang.ThreadGroup
org.apache.avalon.excalibur.thread.impl.DefaultThreadPool
- All Implemented Interfaces:
- org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.excalibur.pool.ObjectFactory, ThreadPool
- public class DefaultThreadPool
- extends ThreadGroup
- implements org.apache.avalon.excalibur.pool.ObjectFactory, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.activity.Disposable, ThreadPool
This class is the public frontend for the thread pool code.
- Author:
- Avalon Development Team
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
enableLogging
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
- Specified by:
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
dispose
public void dispose()
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
newInstance
public Object newInstance()
- Specified by:
newInstance
in interface org.apache.avalon.excalibur.pool.ObjectFactory
decommission
public void decommission(Object object)
- Specified by:
decommission
in interface org.apache.avalon.excalibur.pool.ObjectFactory
getCreatedClass
public Class getCreatedClass()
- Specified by:
getCreatedClass
in interface org.apache.avalon.excalibur.pool.ObjectFactory
execute
public ThreadControl execute(org.apache.avalon.framework.activity.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(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 © . All Rights Reserved.