diff --git a/spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java b/spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java index 36a75716d2..64d4fcae5a 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java +++ b/spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java @@ -30,12 +30,13 @@ import org.springframework.core.annotation.AliasFor; * *

If the event is not published within the boundaries of a managed transaction, the event * is discarded unless the {@link #fallbackExecution} flag is explicitly set. If a - * transaction is running, the event is processed according to its {@link TransactionPhase}. + * transaction is running, the event is processed according to its {@code TransactionPhase}. * *

Adding {@link org.springframework.core.annotation.Order @Order} on your annotated method * allows you to prioritize that listener amongst other listeners running in the same phase. * * @author Stephane Nicoll + * @author Sam Brannen * @since 4.2 */ @EventListener @@ -59,16 +60,17 @@ public @interface TransactionalEventListener { /** * Alias for {@link #classes}. */ - @AliasFor("classes") + @AliasFor(annotation = EventListener.class, attribute = "classes") Class[] value() default {}; /** * The event classes that this listener handles. - *

When this attribute is specified with one value, the method parameter - * may or may not be specified. When this attribute is specified with more - * than one value, the method must not have a parameter. + *

If this attribute is specified with a single value, the annotated + * method may optionally accept a single parameter. However, if this + * attribute is specified with multiple values, the annotated method + * must not declare any parameters. */ - @AliasFor("value") + @AliasFor(annotation = EventListener.class, attribute = "classes") Class[] classes() default {}; /**