Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.geronimo.pool
Class ThreadPool  view ThreadPool download ThreadPool.java

java.lang.Object
  extended byorg.apache.geronimo.pool.ThreadPool
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.Executor, org.apache.geronimo.gbean.GBeanLifecycle

public class ThreadPool
extends java.lang.Object
implements EDU.oswego.cs.dl.util.concurrent.Executor, org.apache.geronimo.gbean.GBeanLifecycle

Version:
$Rev: 151106 $ $Date: 2005-02-02 18:49:54 -0800 (Wed, 02 Feb 2005) $

Field Summary
private  EDU.oswego.cs.dl.util.concurrent.PooledExecutor executor
           
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
private  int nextWorkerID
           
 
Constructor Summary
ThreadPool(int poolSize, java.lang.String poolName, long keepAliveTime, java.lang.ClassLoader classLoader)
           
 
Method Summary
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
 void execute(java.lang.Runnable command)
          Execute the given command.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
private  int getNextWorkerID()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executor

private EDU.oswego.cs.dl.util.concurrent.PooledExecutor executor

nextWorkerID

private int nextWorkerID

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

ThreadPool

public ThreadPool(int poolSize,
                  java.lang.String poolName,
                  long keepAliveTime,
                  java.lang.ClassLoader classLoader)
Method Detail

execute

public void execute(java.lang.Runnable command)
             throws java.lang.InterruptedException
Description copied from interface: EDU.oswego.cs.dl.util.concurrent.Executor
Execute the given command. This method is guaranteed only to arrange for execution, that may actually occur sometime later; for example in a new thread. However, in fully generic use, callers should be prepared for execution to occur in any fashion at all, including immediate direct execution.

The method is defined not to throw any checked exceptions during execution of the command. Generally, any problems encountered will be asynchronous and so must be dealt with via callbacks or error handler objects. If necessary, any context-dependent catastrophic errors encountered during actions that arrange for execution could be accompanied by throwing context-dependent unchecked exceptions.

However, the method does throw InterruptedException: It will fail to arrange for execution if the current thread is currently interrupted. Further, the general contract of the method is to avoid, suppress, or abort execution if interruption is detected in any controllable context surrounding execution.

Specified by:
execute in interface EDU.oswego.cs.dl.util.concurrent.Executor

getNextWorkerID

private int getNextWorkerID()

doStart

public void doStart()
             throws java.lang.Exception
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle

doStop

public void doStop()
            throws java.lang.Exception
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle

doFail

public void doFail()
Description copied from interface: org.apache.geronimo.gbean.GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()