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 Type
    Method
    Description
    void
    beforeCommit(org.apache.geode.cache.TransactionEvent event)
     
    void
     
    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 2 TransactionWriter objects into a composite instance of TransactionWriter functioning as a single instance.
    protected org.apache.geode.cache.TransactionWriter
    Returns a reference to the first TransactionWriter in the composition.
    protected org.apache.geode.cache.TransactionWriter
    Returns a reference to the second TransactionWriter in the composition.
    void
    init(Properties properties)
     
    void
    initialize(org.apache.geode.cache.Cache cache, Properties properties)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 2 TransactionWriter objects into a composite instance of TransactionWriter functioning as a single instance.
      Parameters:
      transactionWriterOne - first TransactionWriter in the composition.
      transactionWriterTwo - second TransactionWriter in the composition.
      Returns:
      the first TransactionWriter if the second TransactionWriter is null, or return the second TransactionWriter if the first TransactionWriter is null, or return the composition of both TransactionWriter one and TransactionWriter two.
      See Also:
      • TransactionWriter
    • getTransactionWriterOne

      protected org.apache.geode.cache.TransactionWriter getTransactionWriterOne()
      Returns a reference to the first TransactionWriter 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 second TransactionWriter 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 interface org.apache.geode.cache.TransactionWriter
      Throws:
      org.apache.geode.cache.TransactionWriterException
    • close

      public void close()
      Specified by:
      close in interface org.apache.geode.cache.CacheCallback
    • init

      public void init(Properties properties)
      Specified by:
      init in interface org.apache.geode.cache.Declarable
    • initialize

      public void initialize(org.apache.geode.cache.Cache cache, Properties properties)
      Specified by:
      initialize in interface org.apache.geode.cache.Declarable