|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.concurrent.Jdk15ThreadPool
public class Jdk15ThreadPool
Fixed size thread pool implementation for usage with java >= 1.5.0
Constructor Summary | |
---|---|
Jdk15ThreadPool()
|
|
Jdk15ThreadPool(int numberOfThreads)
|
|
Jdk15ThreadPool(java.lang.ThreadGroup threadGroup)
|
|
Jdk15ThreadPool(java.lang.ThreadGroup threadGroup,
int numberOfThreads)
|
Method Summary | |
---|---|
int |
getActiveWorkerCount()
Returns the amount of worker threads which are active. |
int |
getCurrentPoolsize()
Returns the amount of workers which are really usable in the underlying ThreadPool. |
int |
getExpectedPoolsize()
Returns the amount of workers the ThreadService expects to to have in the underlying ThreadPool according to the currently active pool size. |
void |
invokeLater(java.lang.Runnable task)
Queues a new task for asynchronous execution in the underlying ThreadPool |
void |
resize(int poolSize)
Resizes the amount of worker threads in the ThreadService to the given size. |
void |
stop()
Shutdown the underlying ThreadPool |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Jdk15ThreadPool()
public Jdk15ThreadPool(int numberOfThreads)
numberOfThreads
- public Jdk15ThreadPool(java.lang.ThreadGroup threadGroup)
threadGroup
- public Jdk15ThreadPool(java.lang.ThreadGroup threadGroup, int numberOfThreads)
threadGroup
- numberOfThreads
- Method Detail |
---|
public int getActiveWorkerCount()
ThreadService
getActiveWorkerCount
in interface ThreadService
public int getCurrentPoolsize()
ThreadService
ThreadService.getExpectedPoolsize()
caused by crashed (or due to too less memory unstarted) worker threads.
getCurrentPoolsize
in interface ThreadService
public int getExpectedPoolsize()
ThreadService
getExpectedPoolsize
in interface ThreadService
public void invokeLater(java.lang.Runnable task)
ThreadService
invokeLater
in interface ThreadService
task
- a task to execute within one of the available worker threadspublic void resize(int poolSize)
ThreadService
resize
in interface ThreadService
poolSize
- the new amount of worker threads in the ThreadServicepublic void stop()
ThreadService
stop
in interface ThreadService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |