|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.tagtraum.perf.threads.Runner
Instances of this class are able to execute the run()
method of a given
Runnable
in a thread. Threads are pooled and reused.
Constructor Summary | |
Runner(int capacity)
|
Method Summary | |
void |
clear()
Stops and dereferences all RunnerThreads. |
void |
destroy()
Stops and dereferences all RunnerThreads and marks this Runner as destroyed. |
protected void |
finalize()
|
int |
getCapacity()
Number of RunnerThreads that the pool can hold. |
protected com.tagtraum.perf.threads.RunnerThread |
getRunnerThread(java.lang.Runnable runnable)
|
java.lang.Class |
getRunnerThreadClass()
RunnerThread class. |
boolean |
isDestroyed()
Indicates whether this Runner is destroyed. |
protected com.tagtraum.perf.threads.RunnerThread |
newRunnerThread()
|
void |
run(java.lang.Runnable runnable)
Runs the runnable in a thread. |
protected void |
setRunnerThreadClass(java.lang.Class runnerThreadClass)
|
int |
size()
Number of RunnerThreads currently in the pool. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Runner(int capacity)
Method Detail |
public void run(java.lang.Runnable runnable)
runnable
- a runnable that shall be runprotected com.tagtraum.perf.threads.RunnerThread getRunnerThread(java.lang.Runnable runnable)
protected com.tagtraum.perf.threads.RunnerThread newRunnerThread()
public java.lang.Class getRunnerThreadClass()
protected void setRunnerThreadClass(java.lang.Class runnerThreadClass)
public int getCapacity()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isDestroyed()
public void destroy()
public void clear()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |