Class LogicRunner
java.lang.Object
com.github.sttk.sabi.LogicRunner
- All Implemented Interfaces:
AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionbeginTxn()Begins a sequential transactionalLogicTxnchain.voidclose()Closes the underlyingDataHuband releases all local data sources and connections.voidUnregisters the data source associated with the specified name if execution has not yet begun.<D> voidExecutes the specifiedLogicin a single non-transactional scope.start()Starts a sequential non-transactionalLogicRunchain.<D> voidExecutes the specifiedLogicwithin a transaction, automatically handling pre-commit, commit, post-commit, rollback, and failure reporting.voidRegisters a session-localDataSrcunder the specified name if execution has not yet begun.
-
Method Details
-
close
public void close()Closes the underlyingDataHuband releases all local data sources and connections.- Specified by:
closein interfaceAutoCloseable
-
uses
-
disuses
Unregisters the data source associated with the specified name if execution has not yet begun.- Parameters:
name- the logical name of the data source to remove
-
run
Executes the specifiedLogicin a single non-transactional scope.- Type Parameters:
D- the type of data access interface expected by the logic- Parameters:
logic- the logic unit to execute- Throws:
com.github.sttk.errs.Err- if the runner is in an abnormal state, local data source setup fails, orlogicthrows anErr
-
start
-
txn
Executes the specifiedLogicwithin a transaction, automatically handling pre-commit, commit, post-commit, rollback, and failure reporting.- Type Parameters:
D- the type of data access interface expected by the logic- Parameters:
logic- the logic unit to execute within the transaction- Throws:
com.github.sttk.errs.Err- if the runner is in an abnormal state, local data source setup fails,logicthrows anErr, or committing the transaction fails
-
beginTxn
-