Interface ServerTransactionManager
-
- All Superinterfaces:
java.lang.AutoCloseable,TransactionManager
- All Known Implementing Classes:
TransactionResourceManager
public interface ServerTransactionManager extends java.lang.AutoCloseable, TransactionManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceServerTransactionManager.InitialSequenceIdPolicystatic interfaceServerTransactionManager.ServerTransactionConfig-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.transaction.TransactionManager
TransactionManager.TransactionConfig
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()voidensureTransactionOpen(java.lang.String transactionId, State state)Ensure that the given transaction ID is initialized.ServerTransactionManager.ServerTransactionConfiggetCfg()Retrieve a configuration read from theRepository.StategetCurrentState(java.lang.String transactionId)Retrieve current state of the transaction.voidhouseKeeping()Called by the server to signal that the manager should reclaim any resources that are not needed anymore.voidrunObservations(java.lang.String name, BiConsumer<StreamElement,Pair<java.lang.Long,java.lang.Object>> updateConsumer, CommitLogObserver requestObserver)Observe all transactional families with given observer.voidwriteResponseAndUpdateState(java.lang.String transactionId, State state, java.lang.String responseId, Response response, CommitCallback callback)Atomically write response and update state of a transaction-
Methods inherited from interface cz.o2.proxima.direct.core.transaction.TransactionManager
getCommitDesc, getRequestDesc, getResponseDesc, getStateDesc, getTransaction
-
-
-
-
Method Detail
-
runObservations
void runObservations(java.lang.String name, BiConsumer<StreamElement,Pair<java.lang.Long,java.lang.Object>> updateConsumer, CommitLogObserver requestObserver)Observe all transactional families with given observer.- Parameters:
name- name of the observer (will be appended with name of the family)updateConsumer- consumer of updates to the view of transaction statesrequestObserver- the observer (need not be synchronized)
-
getCurrentState
State getCurrentState(java.lang.String transactionId)
Retrieve current state of the transaction.- Parameters:
transactionId- ID of the transaction- Returns:
- the
Stateassociated with the transaction on server
-
ensureTransactionOpen
void ensureTransactionOpen(java.lang.String transactionId, State state)Ensure that the given transaction ID is initialized.- Parameters:
transactionId- ID of the transactionstate- the state that the transaction is supposed to have
-
writeResponseAndUpdateState
void writeResponseAndUpdateState(java.lang.String transactionId, State state, java.lang.String responseId, Response response, CommitCallback callback)Atomically write response and update state of a transaction- Parameters:
transactionId- ID of transactionstate- the state to update the transaction toresponseId- ID of responseresponse- the responsecallback- callback for commit after write
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
houseKeeping
void houseKeeping()
Called by the server to signal that the manager should reclaim any resources that are not needed anymore.
-
getCfg
ServerTransactionManager.ServerTransactionConfig getCfg()
Retrieve a configuration read from theRepository.- Specified by:
getCfgin interfaceTransactionManager
-
-