org.apache.excalibur.event.command
Class EventThreadPool

java.lang.Object
  |
  +--org.apache.excalibur.thread.impl.AbstractThreadPool
        |
        +--org.apache.excalibur.event.command.EventThreadPool
All Implemented Interfaces:
Disposable, ObjectFactory, org.apache.excalibur.thread.ThreadPool

public class EventThreadPool
extends org.apache.excalibur.thread.impl.AbstractThreadPool
implements ObjectFactory, Disposable, org.apache.excalibur.thread.ThreadPool

This class is the public frontend for the thread pool code.

Author:
Berin Loritsch, Stefano Mazzocchi, Peter Donald

Constructor Summary
EventThreadPool(int capacity)
           
EventThreadPool(String name, int capacity)
           
EventThreadPool(String name, int capacity, int timeout)
           
 
Method Summary
 void dispose()
           
 void dispose(Object object)
          Performs any deconstruction that is necessary for the object.
 Class getCreatedClass()
          Get the class of the object you are creating.
protected  org.apache.excalibur.thread.impl.WorkerThread getWorker()
          Retrieve a worker thread from pool.
 Object newInstance()
          Create a new instance of the object being pooled.
protected  void releaseWorker(org.apache.excalibur.thread.impl.WorkerThread worker)
           
 
Methods inherited from class org.apache.excalibur.thread.impl.AbstractThreadPool
createWorker, destroyWorker, execute, execute, getName, getThreadGroup, newWorkerThread
 
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
 

Constructor Detail

EventThreadPool

public EventThreadPool(int capacity)
                throws Exception

EventThreadPool

public EventThreadPool(String name,
                       int capacity)
                throws Exception

EventThreadPool

public EventThreadPool(String name,
                       int capacity,
                       int timeout)
                throws Exception
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface Disposable

newInstance

public Object newInstance()
Description copied from interface: ObjectFactory
Create a new instance of the object being pooled.

Specified by:
newInstance in interface ObjectFactory
Returns:
the pooled Object instance

dispose

public void dispose(Object object)
Description copied from interface: ObjectFactory
Performs any deconstruction that is necessary for the object.

Specified by:
dispose in interface ObjectFactory
Parameters:
object - to destroy

getCreatedClass

public Class getCreatedClass()
Description copied from interface: ObjectFactory
Get the class of the object you are creating.

Specified by:
getCreatedClass in interface ObjectFactory
Returns:
Class object of the factory's class

getWorker

protected org.apache.excalibur.thread.impl.WorkerThread getWorker()
Retrieve a worker thread from pool.

Specified by:
getWorker in class org.apache.excalibur.thread.impl.AbstractThreadPool
Returns:
the worker thread retrieved from pool

releaseWorker

protected void releaseWorker(org.apache.excalibur.thread.impl.WorkerThread worker)
Specified by:
releaseWorker in class org.apache.excalibur.thread.impl.AbstractThreadPool


Copyright © 2002 Apache Jakarta Project. All Rights Reserved.