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 TypeMethodDescriptionvoid
beforeCommit
(org.apache.geode.cache.TransactionEvent event) void
close()
static org.apache.geode.cache.TransactionWriter
compose
(org.apache.geode.cache.TransactionWriter transactionWriterOne, org.apache.geode.cache.TransactionWriter transactionWriterTwo) Factory method used to construct and compose 2TransactionWriter
objects into a composite instance ofTransactionWriter
functioning as a single instance.protected org.apache.geode.cache.TransactionWriter
Returns a reference to the firstTransactionWriter
in the composition.protected org.apache.geode.cache.TransactionWriter
Returns a reference to the secondTransactionWriter
in the composition.void
init
(Properties properties) void
initialize
(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 2TransactionWriter
objects into a composite instance ofTransactionWriter
functioning as a single instance.- Parameters:
transactionWriterOne
- firstTransactionWriter
in the composition.transactionWriterTwo
- secondTransactionWriter
in the composition.- Returns:
- the first
TransactionWriter
if the secondTransactionWriter
is null, or return the secondTransactionWriter
if the firstTransactionWriter
is null, or return the composition of bothTransactionWriter
one andTransactionWriter
two. - See Also:
-
TransactionWriter
-
getTransactionWriterOne
protected org.apache.geode.cache.TransactionWriter getTransactionWriterOne()Returns a reference to the firstTransactionWriter
in the composition.- Returns:
- a reference to the first
TransactionWriter
in the composition. - See Also:
-
TransactionWriter
-
getTransactionWriterTwo
protected org.apache.geode.cache.TransactionWriter getTransactionWriterTwo()Returns a reference to the secondTransactionWriter
in the composition.- Returns:
- a reference to the second
TransactionWriter
in the composition. - See Also:
-
TransactionWriter
-
beforeCommit
public void beforeCommit(org.apache.geode.cache.TransactionEvent event) throws org.apache.geode.cache.TransactionWriterException - Specified by:
beforeCommit
in interfaceorg.apache.geode.cache.TransactionWriter
- Throws:
org.apache.geode.cache.TransactionWriterException
-
close
public void close()- Specified by:
close
in interfaceorg.apache.geode.cache.CacheCallback
-
init
- Specified by:
init
in interfaceorg.apache.geode.cache.Declarable
-
initialize
- Specified by:
initialize
in interfaceorg.apache.geode.cache.Declarable
-