org.apache.avalon.excalibur.thread.impl
Class DefaultThreadPool
java.lang.Object
java.lang.ThreadGroup
org.apache.avalon.excalibur.thread.impl.DefaultThreadPool
- All Implemented Interfaces:
- Thread.UncaughtExceptionHandler, ObjectFactory, Disposable, LogEnabled, ThreadPool
public class DefaultThreadPool
- extends ThreadGroup
- implements ObjectFactory, LogEnabled, 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
- Throws:
Exception
DefaultThreadPool
public DefaultThreadPool(String name,
int capacity)
throws Exception
- Throws:
Exception
DefaultThreadPool
public DefaultThreadPool(String name,
int min,
int max)
throws Exception
- Throws:
Exception
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.
- 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 © 2001-2012 The Apache Software Foundation. All Rights Reserved.