|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ten60.netkernel.scheduler.WorkerThreadPool
A ProcessofThreadGroup is a homogeneous collection of ProcessorThreads which can be managed as a group. This includes start/stop/suspend/resume. But also the groups size can be change dynamically.
Field Summary | |
protected ArrayList |
mProcessorThreads
The set of active threads in this group |
Constructor Summary | |
WorkerThreadPool(String aName,
int aInitialThreads,
ThreadGroup aParentGroup)
Creates a new ProcessorThreadGroup. |
Method Summary | |
protected WorkerThread |
createNewThread(ThreadGroup aThisGroup)
Abstract method to instantiate a new instance of a subclass of ProcessorThread to be added to this group. |
int |
getActualThreadCount()
The count of the number of actual threads in this group. |
int |
getSetThreadCount()
|
ThreadGroup |
getThreadGroup()
Returns the real java ThreadGroup object for this group. |
void |
join(long aTimeout)
Wait for all threads in group to stop. |
abstract void |
process()
|
void |
replace(Thread aThread)
The given thread will be removed from the thread pool and replaced with a fresh one |
void |
setCount(int aThreadCount)
Dynamically changes the number of active threads within this group. |
void |
start()
Starts all the threads in the group. |
void |
stop()
Requests that all the threads in the group are stopped. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final ArrayList mProcessorThreads
Constructor Detail |
public WorkerThreadPool(String aName, int aInitialThreads, ThreadGroup aParentGroup)
aName
- The name that the real java ThreadGroup will be givenaInitialThreads
- The initial number of threads that this group will have.aParentGroup
- parent thread groupMethod Detail |
public ThreadGroup getThreadGroup()
public void setCount(int aThreadCount)
aThreadCount
- The desired number of active threads for the group.public int getActualThreadCount()
public int getSetThreadCount()
protected WorkerThread createNewThread(ThreadGroup aThisGroup)
aThisGroup
- The ThreadGroup that the new thread should belong to.
public void start()
public void stop()
public void join(long aTimeout) throws InterruptedException
aTimeout
- time to wait for threads before killing them
InterruptedException
- Thrown if we are interrupted whilst waiting for the threads to die.public void replace(Thread aThread)
aThread
- the thread to replacepublic abstract void process() throws InterruptedException
InterruptedException
|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |