Class TransactionListenerAdapter
java.lang.Object
org.springframework.data.gemfire.transaction.event.TransactionListenerAdapter
- All Implemented Interfaces:
CacheCallback
,Declarable
,TransactionListener
,TransactionWriter
public class TransactionListenerAdapter
extends Object
implements TransactionListener, 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
- Author:
- John Blum
- See Also:
-
Constructor Summary
ConstructorDescriptionTransactionListenerAdapter
(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
(TransactionEvent event) void
void
afterRollback
(TransactionEvent event) void
beforeCommit
(TransactionEvent event) protected 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
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:
-
-
Method Details
-
getApplicationEventPublisher
Returns a reference to the configuredApplicationEventPublisher
.- Returns:
- a reference to the configured
ApplicationEventPublisher
. - See Also:
-
beforeCommit
- Specified by:
beforeCommit
in interfaceTransactionWriter
-
afterCommit
- Specified by:
afterCommit
in interfaceTransactionListener
-
afterFailedCommit
- Specified by:
afterFailedCommit
in interfaceTransactionListener
-
afterRollback
- Specified by:
afterRollback
in interfaceTransactionListener
-