|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.excalibur.thread.impl.AbstractThreadPool
org.apache.avalon.excalibur.thread.impl.BasicThreadPool
class BasicThreadPool
The ThreadPool that binds to Legacy Pooling implementation.
| Field Summary | |
|---|---|
private org.apache.avalon.framework.logger.Logger |
m_logger
The logger to use for debugging purposes. |
private org.apache.avalon.excalibur.pool.Pool |
m_pool
The underlying pool. |
| Constructor Summary | |
|---|---|
BasicThreadPool(java.lang.ThreadGroup threadGroup,
java.lang.String name,
org.apache.avalon.excalibur.pool.Pool pool)
Create a new ThreadPool with specified capacity. |
|
| Method Summary | |
|---|---|
void |
decommission(java.lang.Object object)
|
void |
dispose()
Dispose of underlying pool and cleanup resources. |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Setup Logging. |
org.apache.excalibur.thread.ThreadControl |
execute(org.apache.avalon.framework.activity.Executable work)
Run work in separate thread. |
java.lang.Class |
getCreatedClass()
Return the class of poolable instance. |
protected WorkerThread |
getWorker()
Retrieve a worker thread from pool. |
java.lang.Object |
newInstance()
Create new Poolable instance. |
protected WorkerThread |
newWorkerThread(java.lang.String name)
Overide newWorkerThread to provide a WorkerThread that is Poolable and LogEnabled. |
protected void |
releaseWorker(WorkerThread worker)
Release worker back into pool. |
| Methods inherited from class org.apache.excalibur.thread.impl.AbstractThreadPool |
|---|
createWorker, destroyWorker, execute, execute, getName, getThreadGroup |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.excalibur.thread.ThreadPool |
|---|
execute, execute |
| Field Detail |
|---|
private org.apache.avalon.excalibur.pool.Pool m_pool
private org.apache.avalon.framework.logger.Logger m_logger
| Constructor Detail |
|---|
public BasicThreadPool(java.lang.ThreadGroup threadGroup,
java.lang.String name,
org.apache.avalon.excalibur.pool.Pool pool)
throws java.lang.Exception
threadGroup - the thread group used in poolname - the name of pool (used in naming threads)pool - the underling pool
java.lang.Exception - if unable to create pool| Method Detail |
|---|
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging in interface org.apache.avalon.framework.logger.LogEnabledlogger - the loggerpublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposablepublic java.lang.Object newInstance()
newInstance in interface org.apache.avalon.excalibur.pool.ObjectFactoryprotected WorkerThread newWorkerThread(java.lang.String name)
newWorkerThread in class AbstractThreadPoolname - the name of WorkerThread
public void decommission(java.lang.Object object)
decommission in interface org.apache.avalon.excalibur.pool.ObjectFactorypublic java.lang.Class getCreatedClass()
getCreatedClass in interface org.apache.avalon.excalibur.pool.ObjectFactorypublic org.apache.excalibur.thread.ThreadControl execute(org.apache.avalon.framework.activity.Executable work)
work - the work to be executed.
protected WorkerThread getWorker()
getWorker in class AbstractThreadPoolprotected void releaseWorker(WorkerThread worker)
releaseWorker in class AbstractThreadPoolworker - the worker (Should be a SimpleWorkerThread).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||