public class TransactionalApplicationListenerMethodAdapter extends org.springframework.context.event.ApplicationListenerMethodAdapter implements TransactionalApplicationListener<org.springframework.context.ApplicationEvent>
GenericApplicationListener adapter that delegates the processing of
an event to a TransactionalEventListener annotated method. Supports
the exact same features as any regular EventListener annotated method
but is aware of the transactional context of the event publisher.
Processing of TransactionalEventListener is enabled automatically
when Spring's transaction management is enabled. For other cases, registering
a bean of type TransactionalEventListenerFactory is required.
TransactionalEventListener,
TransactionalApplicationListener,
TransactionalApplicationListenerAdapterTransactionalApplicationListener.SynchronizationCallback| Constructor and Description |
|---|
TransactionalApplicationListenerMethodAdapter(String beanName,
Class<?> targetClass,
Method method)
Construct a new TransactionalApplicationListenerMethodAdapter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCallback(TransactionalApplicationListener.SynchronizationCallback callback)
Add a callback to be invoked on processing within transaction synchronization,
i.e.
|
TransactionPhase |
getTransactionPhase()
Return the
TransactionPhase in which the listener will be invoked. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
doInvoke, getCondition, getDefaultListenerId, getDetailedErrorMessage, getListenerId, getOrder, getTargetBean, getTargetMethod, handleAsyncError, handleResult, processEvent, resolveArguments, supportsEventType, supportsSourceType, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforPayload, forPayload, getListenerId, getOrder, processEventpublic TransactionalApplicationListenerMethodAdapter(String beanName, Class<?> targetClass, Method method)
beanName - the name of the bean to invoke the listener method ontargetClass - the target class that the method is declared onmethod - the listener method to invokepublic TransactionPhase getTransactionPhase()
TransactionalApplicationListenerTransactionPhase in which the listener will be invoked.
The default phase is TransactionPhase.AFTER_COMMIT.
getTransactionPhase in interface TransactionalApplicationListener<org.springframework.context.ApplicationEvent>public void addCallback(TransactionalApplicationListener.SynchronizationCallback callback)
TransactionalApplicationListenerTransactionalApplicationListener.processEvent(E) is being triggered during actual transactions.addCallback in interface TransactionalApplicationListener<org.springframework.context.ApplicationEvent>callback - the synchronization callback to applypublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>onApplicationEvent in class org.springframework.context.event.ApplicationListenerMethodAdapter