class ApplicationListenerMethodTransactionalAdapter extends ApplicationListenerMethodAdapter
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.
ApplicationListenerMethodAdapter
,
TransactionalEventListener
Modifier and Type | Class and Description |
---|---|
private static class |
ApplicationListenerMethodTransactionalAdapter.TransactionSynchronizationEventAdapter |
Modifier and Type | Field and Description |
---|---|
private TransactionalEventListener |
annotation |
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ApplicationListenerMethodTransactionalAdapter(java.lang.String beanName,
java.lang.Class<?> targetClass,
java.lang.reflect.Method method) |
Modifier and Type | Method and Description |
---|---|
private TransactionSynchronization |
createTransactionSynchronization(ApplicationEvent event) |
void |
onApplicationEvent(ApplicationEvent event)
Handle an application event.
|
doInvoke, getCondition, getDetailedErrorMessage, getOrder, getTargetBean, handleResult, processEvent, resolveArguments, supportsEventType, supportsSourceType, toString
private final TransactionalEventListener annotation
public ApplicationListenerMethodTransactionalAdapter(java.lang.String beanName, java.lang.Class<?> targetClass, java.lang.reflect.Method method)
public void onApplicationEvent(ApplicationEvent event)
ApplicationListener
onApplicationEvent
in interface ApplicationListener<ApplicationEvent>
onApplicationEvent
in class ApplicationListenerMethodAdapter
event
- the event to respond toprivate TransactionSynchronization createTransactionSynchronization(ApplicationEvent event)