|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.ThreadGroup
|
+--jrunx.scheduler.ThreadPool
This is the class that encapsulates the configuration of threads for a NetworkService. This class creates the handler threads, managing the low and high water mark of the thread pool being used. It has methods to set and get the different configuration information to manage the threads that are associated with the RunnableFactory that this object manages.
| Field Summary | |
protected int |
activeHandlers
|
protected int |
busyMetric
metric for The number of handlers that are in targetServlet.service(). |
protected int |
delayMetric
metric to measure the average waiting time |
protected int |
gotDelayed
metric for number of requests that were delayed |
protected int |
gotDropped
metric for number of requests that were dropped |
protected int |
idleMetric
metric for number of handlers that are idle waiting for a request |
protected int |
listeningMetric
metric for The number of handlers that are waiting for new connections. |
protected int |
maxHandlers
|
protected int |
minHandlers
The min/active/max number of handler threads. |
protected Metrics |
mm
|
protected RunnableFactory |
service
|
protected int |
threadTimeout
|
protected int |
totalMetric
metric to track total number of threads |
protected int |
waitingMetric
metric for number of handlers that are waiting to run |
| Fields inherited from interface jrunx.metrics.MetricsConstants |
METRICS_BUSY_TH, METRICS_DELAY_MS, METRICS_DELAY_RQ, METRICS_DELAY_TH, METRICS_DROPPED_RQ, METRICS_FREE_MEMORY, METRICS_IDLE_TH, METRICS_LISTEN_TH, METRICS_TOTAL_MEMORY, METRICS_TOTAL_TH |
| Constructor Summary | |
ThreadPool(java.lang.String groupName)
|
|
ThreadPool(java.lang.String groupName,
RunnableFactory factory)
Construct a ThreadPool object for this endpoint. |
|
| Method Summary | |
void |
cleanupHandler()
|
int |
getThreadWaitTimeout()
|
void |
init(RunnableFactory service,
Metrics mm)
|
void |
setActiveThreads(int i)
sets the max active handlers (those not in getEndpoint) |
void |
setMaxThreads(int i)
Sets the maximum number of handler threads. |
void |
setMinThreads(int i)
Sets the minimum number of handler threads. |
void |
setThreadWaitTimeout(int timeoutSeconds)
|
void |
shutdown()
Initiate shutdown. |
protected void |
spawnHandler()
spawn another worker thread |
void |
start()
|
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected RunnableFactory service
protected Metrics mm
protected int minHandlers
protected int activeHandlers
protected int maxHandlers
protected int threadTimeout
protected int listeningMetric
protected int busyMetric
protected int waitingMetric
protected int delayMetric
protected int idleMetric
protected int totalMetric
protected int gotDelayed
protected int gotDropped
| Constructor Detail |
public ThreadPool(java.lang.String groupName,
RunnableFactory factory)
groupName - the name of this threadgroupfactory - the source of all runnable objectspublic ThreadPool(java.lang.String groupName)
| Method Detail |
public void init(RunnableFactory service,
Metrics mm)
public void start()
protected void spawnHandler()
public void cleanupHandler()
public void setMinThreads(int i)
public void setActiveThreads(int i)
public void setMaxThreads(int i)
public void setThreadWaitTimeout(int timeoutSeconds)
public int getThreadWaitTimeout()
public void shutdown()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||