|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.jetspeed.services.threadpool.JetspeedThreadPoolService
This is a Service that provides a simple threadpool usable by all
thread intensive classes in order to optimize resources utilization
screen:
It uses 3 parameters for contolling resource usage:
| Field Summary | |
static int |
DEFAULT_THREAD_PRIORITY
The default priority to use when creating new threads. |
protected static JetspeedLogger |
logger
Static initialization of the logger for this class |
| Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, properties, serviceBroker |
| Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
| Fields inherited from interface org.apache.jetspeed.services.threadpool.ThreadPoolService |
SERVICE_NAME |
| Constructor Summary | |
JetspeedThreadPoolService()
Constructor. |
|
| Method Summary | |
int |
getAvailableThreadCount()
Get the number of threads that are available. |
int |
getQueueLength()
Get the current length of the Runnable queue, waiting for processing |
int |
getThreadCount()
Get the number of threads that have been created |
int |
getThreadProcessedCount()
Get the number of threads that have successfully been processed for logging and debugging purposes. |
void |
init()
Late init. |
void |
init(javax.servlet.ServletConfig config)
Called during Turbine.init() |
void |
process(java.lang.Runnable runnable)
Processes the Runnable object with an available thread at default priority |
void |
process(java.lang.Runnable runnable,
int priority)
Process a Runnable object by allocating a Thread for it at the given priority |
| Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init, shutdown |
| Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
| Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
| Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker, shutdown |
| Field Detail |
protected static final JetspeedLogger logger
public static final int DEFAULT_THREAD_PRIORITY
| Constructor Detail |
public JetspeedThreadPoolService()
throws java.lang.Exception
Exception, - a generic exception.
java.lang.Exception| Method Detail |
public void init()
init in interface org.apache.turbine.services.Initablepublic void init(javax.servlet.ServletConfig config)
config - A ServletConfig.public void process(java.lang.Runnable runnable)
process in interface ThreadPoolServicerunnable - the runnable code to processprocess( Runnable, int )
public void process(java.lang.Runnable runnable,
int priority)
process in interface ThreadPoolServicerunnable - the runnable code to processpriority - the priority used be the thread that will run this runnablepublic int getThreadCount()
public int getAvailableThreadCount()
public int getQueueLength()
public int getThreadProcessedCount()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||