Class JournalTransactionalResourceServicePersistenceEnvironment
java.lang.Object
dev.getelements.elements.rt.transact.JournalTransactionalResourceServicePersistenceEnvironment
- All Implemented Interfaces:
PersistenceEnvironment
,TransactionalResourceServicePersistence
public class JournalTransactionalResourceServicePersistenceEnvironment
extends Object
implements PersistenceEnvironment, TransactionalResourceServicePersistence
-
Constructor Summary
ConstructorsConstructorDescriptionJournalTransactionalResourceServicePersistenceEnvironment
(jakarta.inject.Provider<Snapshot.Builder> snapshotBuilderProvider, DataStore dataStore, TransactionJournal transactionJournal, JournalTransactionalPersistenceDriver journalTransactionalPersistenceDriver) -
Method Summary
Modifier and TypeMethodDescriptionStarts building an instance ofReadOnlyTransaction
against the underlying data store.Starts building an instance ofReadWriteTransaction
against the underlying data store.jakarta.inject.Provider
<Snapshot.Builder> Opens aExclusiveReadWriteTransaction
which will lock the entire underlying data storage such that certain operations may be performed against the whole dataset.void
start()
Starts thePersistenceEnvironment
instance and obtains all resources necessary to begin accessing the underlying data store.void
stop()
Closes thisPersistenceEnvironment
instance and releases any underlying connections to the data storage.
-
Constructor Details
-
JournalTransactionalResourceServicePersistenceEnvironment
@Inject public JournalTransactionalResourceServicePersistenceEnvironment(jakarta.inject.Provider<Snapshot.Builder> snapshotBuilderProvider, DataStore dataStore, TransactionJournal transactionJournal, JournalTransactionalPersistenceDriver journalTransactionalPersistenceDriver)
-
-
Method Details
-
start
public void start()Description copied from interface:PersistenceEnvironment
Starts thePersistenceEnvironment
instance and obtains all resources necessary to begin accessing the underlying data store.- Specified by:
start
in interfacePersistenceEnvironment
-
stop
public void stop()Description copied from interface:PersistenceEnvironment
Closes thisPersistenceEnvironment
instance and releases any underlying connections to the data storage. Outstanding transactions may be forcibly closed if this is called.- Specified by:
stop
in interfacePersistenceEnvironment
-
buildRO
Description copied from interface:TransactionalResourceServicePersistence
Starts building an instance ofReadOnlyTransaction
against the underlying data store.- Specified by:
buildRO
in interfaceTransactionalResourceServicePersistence
- Parameters:
nodeId
- theNodeId
to use for the transaction context.- Returns:
- the
ReadOnlyTransaction
-
buildRW
Description copied from interface:TransactionalResourceServicePersistence
Starts building an instance ofReadWriteTransaction
against the underlying data store.- Specified by:
buildRW
in interfaceTransactionalResourceServicePersistence
- Parameters:
nodeId
- theNodeId
to use for the transaction context.- Returns:
- the
ReadOnlyTransaction
-
openExclusiveRW
Description copied from interface:TransactionalResourceServicePersistence
Opens aExclusiveReadWriteTransaction
which will lock the entire underlying data storage such that certain operations may be performed against the whole dataset. Generally this should be avoided as it incurs a steep performance penalty.- Specified by:
openExclusiveRW
in interfaceTransactionalResourceServicePersistence
- Returns:
- the
ExclusiveReadWriteTransaction
-
getSnapshotBuilderProvider
-
getDataStore
-
getTransactionJournal
-
getJournalTransactionalPersistenceDriver
-