Package com.powsybl.computation
Class AbstractExecutionHandler<R>
java.lang.Object
com.powsybl.computation.AbstractExecutionHandler<R>
- Type Parameters:
R
-
- All Implemented Interfaces:
ExecutionHandler<R>
- Direct Known Subclasses:
AmplModelExecutionHandler
,SecurityAnalysisExecutionHandler
Provides some default method implementations for
ExecutionHandler
s implementations.- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>, Teofil Calin BANC <teofil-calin.banc at rte-france.com>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionafter
(Path workingDir, ExecutionReport report) Method called by theComputationManager
with the working directory and an execution report as parameters, after the commands defined by theExecutionHandler.before(java.nio.file.Path)
method have been executed: it is in charge of any postprocessing and of providing the actual computation result.void
onExecutionCompletion
(CommandExecution execution, int executionIndex) Empty implementation.void
onExecutionStart
(CommandExecution execution, int executionIndex) Empty implementation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.powsybl.computation.ExecutionHandler
before
-
Constructor Details
-
AbstractExecutionHandler
public AbstractExecutionHandler()
-
-
Method Details
-
onExecutionStart
Empty implementation.- Specified by:
onExecutionStart
in interfaceExecutionHandler<R>
-
onExecutionCompletion
Empty implementation.- Specified by:
onExecutionCompletion
in interfaceExecutionHandler<R>
-
after
Method called by theComputationManager
with the working directory and an execution report as parameters, after the commands defined by theExecutionHandler.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
ExecutionHandler.before(java.nio.file.Path)
throws an exception, or if the execution is cancelled. That implementation checks theExecutionReport
for errors, and throws aPowsyblException
in that case. May be called by actual implementations.- Specified by:
after
in interfaceExecutionHandler<R>
- Parameters:
workingDir
- the working directory used for this computation. Results may be read from it.report
- the execution report, in particular reporting command execution errors.- Returns:
- the actual result of the processing.
- Throws:
IOException
- if and error occurs while reading results from the working directory.
-