|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Controller interface for thread pools. It allows increasing or decreasing the number of threads in the pool.
Field Summary | |
static long |
DEFAULT_WAIT_TIMEOUT
The default timeout. |
Method Summary | |
void |
addThreads(int i)
Adds threads in the pool. |
int |
getCapacity()
Returns the capacity of the pool. |
int |
getNbActiveThreads()
Returns the number of currently active threads. |
long |
getWaitTimeout()
Returns the timeout while "dying" thread can be "reactivated". |
void |
removeThreads(int i)
Removes threads from the pool. |
void |
setCapacity(int i)
Sets the capacity of the pool. |
void |
setWaitTimeout(long millis)
Sets the timeout while a "dying" thread can be "reactivated" and reused, rather than create a new thread. |
Field Detail |
public static final long DEFAULT_WAIT_TIMEOUT
setWaitTimeout(long)
,
Constant Field ValuesMethod Detail |
public void setCapacity(int i)
i
- the capacity of the pool.public int getCapacity()
public void setWaitTimeout(long millis)
millis
- timeout in millisecond.public long getWaitTimeout()
public int getNbActiveThreads()
public void addThreads(int i) throws ThreadPoolOverflowException, IllegalLifeCycleException
TaskLifeCycleController
)
the added threads are immediatly interrupted.
i
- the number of thread to add.
ThreadPoolOverflowException
- if
getNbActiveThread() + i > getCapacity()
IllegalLifeCycleException
- if the component this interface belong
has a lifecycle controller and is in the
LifeCycleController.STOPPED
state.public void removeThreads(int i) throws IllegalLifeCycleException
i
- the number of thread to remove.
IllegalLifeCycleException
- if the component this interface belong
has a lifecycle controller and is in the
LifeCycleController.STOPPED
state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |