Class TransactionListenerAdapter

java.lang.Object
org.springframework.data.gemfire.transaction.event.TransactionListenerAdapter
All Implemented Interfaces:
org.apache.geode.cache.CacheCallback, org.apache.geode.cache.Declarable, org.apache.geode.cache.TransactionListener, org.apache.geode.cache.TransactionWriter

public class TransactionListenerAdapter extends Object implements org.apache.geode.cache.TransactionListener, org.apache.geode.cache.TransactionWriter
The TransactionListenerAdapter class is an Apache Geode TransactionListener and TransactionWriter implementation that publishes the TransactionEvent to application components and beans declared in the Spring ApplicationContext using the ApplicationEventPublisher.
Since:
2.3.0
See Also:
  • TransactionEvent
  • TransactionListener
  • TransactionWriter
  • ApplicationContext
  • ApplicationEventPublisher
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransactionListenerAdapter(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
    Constructs a new instance of the TransactionListenerAdapter initialized with the required ApplicationEventPublisher to publish Apache Geode cache TransactionEvents to application declared components and beans in a Spring ApplicationContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterCommit(org.apache.geode.cache.TransactionEvent event)
     
    void
    afterFailedCommit(org.apache.geode.cache.TransactionEvent event)
     
    void
    afterRollback(org.apache.geode.cache.TransactionEvent event)
     
    void
    beforeCommit(org.apache.geode.cache.TransactionEvent event)
     
    protected org.springframework.context.ApplicationEventPublisher
    Returns a reference to the configured ApplicationEventPublisher.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.geode.cache.CacheCallback

    close

    Methods inherited from interface org.apache.geode.cache.Declarable

    init, initialize
  • Constructor Details

    • TransactionListenerAdapter

      public TransactionListenerAdapter(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Constructs a new instance of the TransactionListenerAdapter initialized with the required ApplicationEventPublisher to publish Apache Geode cache TransactionEvents to application declared components and beans in a Spring ApplicationContext.
      Parameters:
      applicationEventPublisher - ApplicationEventPublisher used to publish Apache Geode cache TransactionEvents.
      Throws:
      IllegalArgumentException - if the ApplicationEventPublisher is null.
      See Also:
      • ApplicationEventPublisher
  • Method Details

    • getApplicationEventPublisher

      @NonNull protected org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
      Returns a reference to the configured ApplicationEventPublisher.
      Returns:
      a reference to the configured ApplicationEventPublisher.
      See Also:
      • ApplicationEventPublisher
    • beforeCommit

      public void beforeCommit(org.apache.geode.cache.TransactionEvent event)
      Specified by:
      beforeCommit in interface org.apache.geode.cache.TransactionWriter
    • afterCommit

      public void afterCommit(org.apache.geode.cache.TransactionEvent event)
      Specified by:
      afterCommit in interface org.apache.geode.cache.TransactionListener
    • afterFailedCommit

      public void afterFailedCommit(org.apache.geode.cache.TransactionEvent event)
      Specified by:
      afterFailedCommit in interface org.apache.geode.cache.TransactionListener
    • afterRollback

      public void afterRollback(org.apache.geode.cache.TransactionEvent event)
      Specified by:
      afterRollback in interface org.apache.geode.cache.TransactionListener