Class AbstractDOMTransactionFactory<T extends DOMStoreTransactionFactory>
java.lang.Object
org.opendaylight.controller.cluster.databroker.AbstractDOMTransactionFactory<T>
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
AbstractDOMBroker
public abstract class AbstractDOMTransactionFactory<T extends DOMStoreTransactionFactory>
extends Object
implements AutoCloseable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractDOMTransactionFactory
(Map<LogicalDatastoreType, T> txFactories) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Checks if instance is not closed.void
close()
protected abstract FluentFuture<? extends CommitInfo>
commit
(DOMDataTreeWriteTransaction transaction, DOMStoreThreePhaseCommitCohort cohort) Submits a transaction asynchronously for commit.final Map<LogicalDatastoreType,
T> Convenience accessor of backing factories intended to be used only by finalization of this class.Creates a new read-only transaction.Creates a new read-write transaction.protected abstract Object
Implementations must return unique identifier for each and every call of this method.Creates a new write-only transaction.
-
Constructor Details
-
AbstractDOMTransactionFactory
-
-
Method Details
-
newTransactionIdentifier
Implementations must return unique identifier for each and every call of this method.- Returns:
- new Unique transaction identifier.
-
commit
protected abstract FluentFuture<? extends CommitInfo> commit(DOMDataTreeWriteTransaction transaction, DOMStoreThreePhaseCommitCohort cohort) Submits a transaction asynchronously for commit.- Parameters:
transaction
- the transaction to submitcohort
- the associated cohort- Returns:
- a resulting Future
-
newReadOnlyTransaction
Creates a new read-only transaction.- Returns:
- the transaction instance
-
newWriteOnlyTransaction
Creates a new write-only transaction.- Returns:
- the transaction instance
-
newReadWriteTransaction
Creates a new read-write transaction.- Returns:
- the transaction instance
-
getTxFactories
Convenience accessor of backing factories intended to be used only by finalization of this class. Note: Finalization of this class may want to access other functionality of supplied Transaction factories.- Returns:
- Map of backing transaction factories.
-
checkNotClosed
protected final void checkNotClosed()Checks if instance is not closed.- Throws:
IllegalStateException
- If instance of this class was closed.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-