|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.semanticweb.elk.util.concurrent.computation.ComputationExecutor
public class ComputationExecutor
A custom ExecutorService for starting a several copies of runnable
tasks, and waiting for it computation; it allows to interrupt all running
tasks without shutting down the ExecutorService. If terminated, the
tasks can be started again.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy |
| Constructor Summary | |
|---|---|
ComputationExecutor(int threadCount,
ComputationThreadGroup threadGroup)
Create a ComputationExecutor with a given maximal number of
threads and the given thread group |
|
ComputationExecutor(int threadCount,
String name)
Create a ComputationExecutor with a given maximal number of
threads and the the given name which is used to identify threads |
|
| Method Summary | |
|---|---|
void |
interrupt()
Interrupting all threads of this executor (used to wake up waiting threads if something needs to be notified) |
boolean |
start(Runnable job,
int noCopies)
Starts a several copies of jobs. |
void |
waitDone()
Waits until all computations are done |
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComputationExecutor(int threadCount,
ComputationThreadGroup threadGroup)
ComputationExecutor with a given maximal number of
threads and the given thread group
threadCount - threadGroup -
public ComputationExecutor(int threadCount,
String name)
ComputationExecutor with a given maximal number of
threads and the the given name which is used to identify threads
threadCount - name - | Method Detail |
|---|
public boolean start(Runnable job,
int noCopies)
waitDone() is called
job - noCopies -
true if the jobs have been startedpublic void interrupt()
public void waitDone()
throws InterruptedException
InterruptedException - if was interrupted while waiting
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||