Spring Data for VMware GemFire
Class ComposableTransactionWriter
java.lang.Object
org.springframework.data.gemfire.transaction.event.ComposableTransactionWriter
- All Implemented Interfaces:
org.apache.geode.cache.CacheCallback,org.apache.geode.cache.Declarable,org.apache.geode.cache.TransactionWriter
public class ComposableTransactionWriter
extends Object
implements org.apache.geode.cache.TransactionWriter
An implementation of Apache Geode's
TransactionWriter interface that uses the Composite Software Design
Pattern to compose multiple TransactionWriter objects into a single instance.- Since:
- 2.3.0
- See Also:
-
TransactionWriter
-
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeCommit(org.apache.geode.cache.TransactionEvent event) voidclose()static org.apache.geode.cache.TransactionWritercompose(org.apache.geode.cache.TransactionWriter transactionWriterOne, org.apache.geode.cache.TransactionWriter transactionWriterTwo) Factory method used to construct and compose 2TransactionWriterobjects into a composite instance ofTransactionWriterfunctioning as a single instance.protected org.apache.geode.cache.TransactionWriterReturns a reference to the firstTransactionWriterin the composition.protected org.apache.geode.cache.TransactionWriterReturns a reference to the secondTransactionWriterin the composition.voidinit(Properties properties) voidinitialize(org.apache.geode.cache.Cache cache, Properties properties)
-
Method Details
-
compose
@Nullable public static org.apache.geode.cache.TransactionWriter compose(@Nullable org.apache.geode.cache.TransactionWriter transactionWriterOne, @Nullable org.apache.geode.cache.TransactionWriter transactionWriterTwo) Factory method used to construct and compose 2TransactionWriterobjects into a composite instance ofTransactionWriterfunctioning as a single instance.- Parameters:
transactionWriterOne- firstTransactionWriterin the composition.transactionWriterTwo- secondTransactionWriterin the composition.- Returns:
- the first
TransactionWriterif the secondTransactionWriteris null, or return the secondTransactionWriterif the firstTransactionWriteris null, or return the composition of bothTransactionWriterone andTransactionWritertwo. - See Also:
-
TransactionWriter
-
getTransactionWriterOne
protected org.apache.geode.cache.TransactionWriter getTransactionWriterOne()Returns a reference to the firstTransactionWriterin the composition.- Returns:
- a reference to the first
TransactionWriterin the composition. - See Also:
-
TransactionWriter
-
getTransactionWriterTwo
protected org.apache.geode.cache.TransactionWriter getTransactionWriterTwo()Returns a reference to the secondTransactionWriterin the composition.- Returns:
- a reference to the second
TransactionWriterin the composition. - See Also:
-
TransactionWriter
-
beforeCommit
public void beforeCommit(org.apache.geode.cache.TransactionEvent event) throws org.apache.geode.cache.TransactionWriterException - Specified by:
beforeCommitin interfaceorg.apache.geode.cache.TransactionWriter- Throws:
org.apache.geode.cache.TransactionWriterException
-
close
public void close()- Specified by:
closein interfaceorg.apache.geode.cache.CacheCallback
-
init
- Specified by:
initin interfaceorg.apache.geode.cache.Declarable
-
initialize
- Specified by:
initializein interfaceorg.apache.geode.cache.Declarable
-