|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.TimerTask de.netseeker.ejoe.concurrent.ThreadPoolResizer
public final class ThreadPoolResizer
A controller thread which monitors a ThreadService and ensures that the limit of worker threads within the ThreadService will be adjusted according to the workload.
Constructor Summary | |
---|---|
ThreadPoolResizer(ThreadService pool,
int maxPoolSize,
long millisBeforeShrink)
Creates a new instance of ThreadPoolResizer, which can be scheduled via using a Timer and will monitor
and eventually resize the given ThreadService up to the given limit of workers by checking the workload
of the pool. |
Method Summary | |
---|---|
void |
run()
|
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadPoolResizer(ThreadService pool, int maxPoolSize, long millisBeforeShrink)
Timer
and will monitor
and eventually resize the given ThreadService
up to the given limit of workers by checking the workload
of the pool. If the workload is very high in all checks during the given period (millisBeforeShrink) the amount
of workers in the monitored ThreadService
will be increased to a calculated size between 1 and the given
limit of workers. If the workload is too low the amount of workers will get reduced.
pool
- a ThreadService
to monitormaxPoolSize
- the limit of worker threads for the ThreadService
millisBeforeShrink
- the period before the ThreadService
will get resizedMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |