public interface ExecutionHandler<R>
ComputationManager
.
The before(Path)
method will be called before the commands are actually executed:
it is in charge of any preprocessing of providing the list of commands to be executed.
Typically, it will copy input data to the specified working directory,
and create the command to be executed with those inputs.
The after(Path, ExecutionReport)
method will be called after the commands have been executed:
it is in charge of any postprocessing and of providing the actual computation result.
Typically, it will check that the execution was correctly peformed, then read command results
from the specified working directory and translate it to a business object.
The generic parameter R
is the type of the result object provided by the command execution.
Modifier and Type | Method and Description |
---|---|
R |
after(Path workingDir,
ExecutionReport report)
Method called by the
ComputationManager with the working directory and an execution report as parameters,
after the commands defined by the before(java.nio.file.Path) method have been executed:
it is in charge of any postprocessing and of providing the actual computation result. |
List<CommandExecution> |
before(Path workingDir)
Method called by the
ComputationManager with the working directory as parameter,
before the commands are actually executed:
it is in charge of any preprocessing of providing the list of commands to be executed. |
void |
onExecutionCompletion(CommandExecution execution,
int executionIndex) |
void |
onExecutionStart(CommandExecution execution,
int executionIndex) |
List<CommandExecution> before(Path workingDir) throws IOException
ComputationManager
with the working directory as parameter,
before the commands are actually executed:
it is in charge of any preprocessing of providing the list of commands to be executed.
Typically, it will copy input data to the specified working directory,
and create the command to be executed with those inputs.
If the call throws an exception, no command will be executed.
workingDir
- the working directory used for this computation. Input data may be written to it.CommandExecution
s to be executed.IOException
- when an error occurs while wirting to working directory.void onExecutionStart(CommandExecution execution, int executionIndex)
void onExecutionCompletion(CommandExecution execution, int executionIndex)
R after(Path workingDir, ExecutionReport report) throws IOException
ComputationManager
with the working directory and an execution report as parameters,
after the commands defined by the before(java.nio.file.Path)
method have been executed:
it is in charge of any postprocessing and of providing the actual computation result.
Typically, it will check that the execution was correctly performed, then read command results
from the specified working directory and translate it to a business object.
That method will not be called in case the call to before(java.nio.file.Path)
throws an exception,
or if the execution is cancelled.
workingDir
- the working directory used for this computation. Results may be read from it.report
- the execution report, in particular reporting command execution errors.IOException
- if and error occurs while reading results from the working directory.Copyright © 2020. All rights reserved.