Class LogicRun
java.lang.Object
com.github.sttk.sabi.LogicRun
Executes a sequence of
Logic units in a non-transactional scope.
A LogicRun is started via LogicRunner.start() or DataAcc.start() and
terminated by calling end(). Logic units can be chained with run(Logic), runForce(Logic), and runOrBlock(Logic) to control error propagation across steps.
-
Method Summary
Modifier and TypeMethodDescriptionvoidend()Completes thisLogicRunsequence, closing connections created during a top-level run and throwing anErrif setup failed, any chained logic failed, or theDataHubis in an abnormal state.<D> LogicRunExecutes the specifiedLogicif no priorErrhas occurred and execution has not been blocked or terminated abnormally.<D> LogicRunExecutes the specifiedLogiceven if a priorrun(Logic)orrunForce(Logic)call recorded anErr, provided execution has not been blocked byrunOrBlock(Logic), setup did not fail, and theDataHubis not in an abnormal state.<D> LogicRunrunOrBlock(Logic<D> logic) Executes the specifiedLogicif no priorErrhas occurred, and blocks all subsequentrun(Logic),runForce(Logic), andrunOrBlock(Logic)calls in this chain if it throws anErr.
-
Method Details
-
run
Executes the specifiedLogicif no priorErrhas occurred and execution has not been blocked or terminated abnormally.If
logicthrows anErr, it is recorded and reported whenend()is called. If an unhandledRuntimeExceptionorErroris thrown, the underlyingDataHubis terminated abnormally and the exception or error is rethrown.- Type Parameters:
D- the type of data access interface expected by the logic- Parameters:
logic- the logic unit to execute- Returns:
- this
LogicRuninstance for method chaining
-
runForce
Executes the specifiedLogiceven if a priorrun(Logic)orrunForce(Logic)call recorded anErr, provided execution has not been blocked byrunOrBlock(Logic), setup did not fail, and theDataHubis not in an abnormal state.- Type Parameters:
D- the type of data access interface expected by the logic- Parameters:
logic- the logic unit to execute- Returns:
- this
LogicRuninstance for method chaining
-
runOrBlock
Executes the specifiedLogicif no priorErrhas occurred, and blocks all subsequentrun(Logic),runForce(Logic), andrunOrBlock(Logic)calls in this chain if it throws anErr.- Type Parameters:
D- the type of data access interface expected by the logic- Parameters:
logic- the logic unit to execute- Returns:
- this
LogicRuninstance for method chaining
-
end
public void end() throws com.github.sttk.errs.ErrCompletes thisLogicRunsequence, closing connections created during a top-level run and throwing anErrif setup failed, any chained logic failed, or theDataHubis in an abnormal state.- Throws:
com.github.sttk.errs.Err- if local data source setup failed, one or more logic executions threw anErr, or theDataHubis in an abnormal state
-