Class Executor
java.lang.Object
com.github.kokorin.jaffree.process.Executor
Executor starts threads with provided
Runnables and controls all threads it has started.
If exception appears in any of the threads the starter thread is interrupted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes provided Runnable.Returns exceptions (if any) caught during execution.Returns names of all threads that are still running.booleanvoidstop()Stop execution of all threads started so far (by interruption) threads that are still alive and haven't been interrupted.
-
Constructor Details
-
Executor
CreatesExecutor.- Parameters:
contextName- context name for logging
-
-
Method Details
-
execute
Executes provided Runnable.Note: interrupts invoking thread if exception appears
- Parameters:
name- thread name suffixrunnable- runnable to execute
-
getExceptions
Returns exceptions (if any) caught during execution.- Returns:
- exceptions
-
stop
public void stop()Stop execution of all threads started so far (by interruption) threads that are still alive and haven't been interrupted. -
isRunning
public boolean isRunning()- Returns:
- true if at least one of threads is still running.
-
getRunningThreadNames
Returns names of all threads that are still running.- Returns:
- threads' names
-