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
ConstructorDescriptionTransactionListenerAdapter
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) Constructs a new instance of theTransactionListenerAdapter
initialized with the requiredApplicationEventPublisher
to publish Apache Geode cacheTransactionEvents
to application declared components and beans in a SpringApplicationContext
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 configuredApplicationEventPublisher
.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 theTransactionListenerAdapter
initialized with the requiredApplicationEventPublisher
to publish Apache Geode cacheTransactionEvents
to application declared components and beans in a SpringApplicationContext
.- Parameters:
applicationEventPublisher
-ApplicationEventPublisher
used to publish Apache Geode cacheTransactionEvents
.- Throws:
IllegalArgumentException
- if theApplicationEventPublisher
is 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:
beforeCommit
in interfaceorg.apache.geode.cache.TransactionWriter
-
afterCommit
public void afterCommit(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterCommit
in interfaceorg.apache.geode.cache.TransactionListener
-
afterFailedCommit
public void afterFailedCommit(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterFailedCommit
in interfaceorg.apache.geode.cache.TransactionListener
-
afterRollback
public void afterRollback(org.apache.geode.cache.TransactionEvent event) - Specified by:
afterRollback
in interfaceorg.apache.geode.cache.TransactionListener
-