@Module public abstract class AbstractThreadLauncher1 extends AbstractTaskWorker1
Modifier | Constructor and Description |
---|---|
protected |
AbstractThreadLauncher1() |
protected |
AbstractThreadLauncher1(java.lang.ClassLoader loader) |
Modifier and Type | Method and Description |
---|---|
boolean |
childIdleBegin()
Start the idle if the child idle is less than idle max.
|
void |
destroy() |
protected boolean |
doStart()
Checks if the launcher should start another thread.
|
long |
getCreateCountTotal() |
int |
getIdleCount() |
int |
getIdleMax()
Gets the maximum number of idle threads.
|
int |
getIdleMin()
Gets the minimum number of idle threads.
|
long |
getIdleTimeout()
Returns the idle timeout.
|
int |
getStartingCount() |
int |
getThreadCount() |
int |
getThreadMax()
Gets the maximum number of threads.
|
protected boolean |
isEnable() |
boolean |
isIdleExpire()
Returns true if the thread should expire instead of going to the idle state.
|
protected boolean |
isIdleTooLow(int startingCount) |
protected boolean |
isPermanent() |
boolean |
isThreadMax() |
protected abstract void |
launchChildThread(int id) |
void |
onChildIdleBegin()
Called by the thread before going into the idle state.
|
void |
onChildIdleEnd()
Called by the thread after exiting the idle state.
|
void |
onChildThreadBegin()
Thread activity management
|
void |
onChildThreadEnd()
Thread activity management
|
void |
onChildThreadResume()
Resume a child, i.e.
|
protected void |
onThreadMax() |
protected void |
onThrottle(java.lang.String msg) |
long |
runTask() |
void |
setIdleMax(int max)
Sets the maximum number of idle threads.
|
void |
setIdleMin(int min)
Sets the minimum number of idle threads.
|
void |
setIdleTimeout(long timeout)
Sets the idle timeout
|
void |
setThreadMax(int max)
Sets the maximum number of threads.
|
void |
setThrottleLimit(int limit)
Sets the throttle limit.
|
void |
setThrottlePeriod(long period)
Sets the throttle period.
|
void |
setThrottleSleepTime(long period)
Sets the throttle sleep time.
|
void |
start() |
protected void |
update() |
protected void |
updateIdleExpireTime(long now)
updates the thread idle expire time.
|
protected void |
updateThrottle()
Throttle the thread creation, so only 100 threads/sec (default) can
be created.
|
getCurrentTimeActual, getThreadName, isClosed, isTaskActive, onThreadComplete, onThreadStart, run, setLoopCount, setWorkerIdleTimeout, startWorkerThread, toString, wake
protected AbstractThreadLauncher1()
protected AbstractThreadLauncher1(java.lang.ClassLoader loader)
protected abstract void launchChildThread(int id)
public void setThreadMax(int max)
public int getThreadMax()
public void setIdleMin(int min)
public int getIdleMin()
public void setIdleMax(int max)
public int getIdleMax()
public void setIdleTimeout(long timeout)
public long getIdleTimeout()
protected boolean isEnable()
public void setThrottlePeriod(long period)
public void setThrottleLimit(int limit)
public void setThrottleSleepTime(long period)
public void start()
public void destroy()
destroy
in class AbstractTaskWorker1
public boolean isThreadMax()
public void onChildThreadBegin()
public void onChildThreadResume()
public void onChildThreadEnd()
public boolean isIdleExpire()
public boolean childIdleBegin()
public void onChildIdleBegin()
public void onChildIdleEnd()
protected void updateIdleExpireTime(long now)
protected boolean doStart()
protected boolean isIdleTooLow(int startingCount)
protected boolean isPermanent()
isPermanent
in class AbstractTaskWorker1
protected void update()
protected void updateThrottle()
protected void onThreadMax()
protected void onThrottle(java.lang.String msg)
public int getThreadCount()
public int getIdleCount()
public int getStartingCount()
public long getCreateCountTotal()
public long runTask()
runTask
in class AbstractTaskWorker1