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 interface
ServerTransactionManager.InitialSequenceIdPolicy
static interface
ServerTransactionManager.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 void
close()
void
ensureTransactionOpen(java.lang.String transactionId, State state)
Ensure that the given transaction ID is initialized.ServerTransactionManager.ServerTransactionConfig
getCfg()
Retrieve a configuration read from theRepository
.State
getCurrentState(java.lang.String transactionId)
Retrieve current state of the transaction.void
houseKeeping()
Called by the server to signal that the manager should reclaim any resources that are not needed anymore.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.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-
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
State
associated 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:
close
in 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:
getCfg
in interfaceTransactionManager
-
-