Spring Data for VMware GemFire
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:
-
TransactionEventTransactionListenerTransactionWriterApplicationContextApplicationEventPublisher
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionListenerAdapter(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Constructs a new instance of theTransactionListenerAdapterinitialized with the requiredApplicationEventPublisherto publish Apache Geode cacheTransactionEventsto application declared components and beans in a SpringApplicationContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCommit(org.apache.geode.cache.TransactionEvent event) voidafterFailedCommit(org.apache.geode.cache.TransactionEvent event) voidafterRollback(org.apache.geode.cache.TransactionEvent event) voidbeforeCommit(org.apache.geode.cache.TransactionEvent event) protected org.springframework.context.ApplicationEventPublisherReturns a reference to the configuredApplicationEventPublisher.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.geode.cache.CacheCallback
closeMethods 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 theTransactionListenerAdapterinitialized with the requiredApplicationEventPublisherto publish Apache Geode cacheTransactionEventsto application declared components and beans in a SpringApplicationContext.- Parameters:
applicationEventPublisher-ApplicationEventPublisherused to publish Apache Geode cacheTransactionEvents.- Throws:
IllegalArgumentException- if theApplicationEventPublisheris null.- See Also:
-
ApplicationEventPublisher
-
-
Method Details
-
getApplicationEventPublisher
@NonNull protected org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()Returns a reference to the configuredApplicationEventPublisher.- Returns:
- a reference to the configured
ApplicationEventPublisher. - See Also:
-
ApplicationEventPublisher
-
beforeCommit
public void beforeCommit(org.apache.geode.cache.TransactionEvent event) - Specified by:
beforeCommitin interfaceorg.apache.geode.cache.TransactionWriter
-
afterCommit
public void afterCommit(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterCommitin interfaceorg.apache.geode.cache.TransactionListener
-
afterFailedCommit
public void afterFailedCommit(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterFailedCommitin interfaceorg.apache.geode.cache.TransactionListener
-
afterRollback
public void afterRollback(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterRollbackin interfaceorg.apache.geode.cache.TransactionListener
-