Skip to content

Commit 164bed5

Browse files
committed
Use implicit aliases in @TransactionalEventListener
1 parent 3eacb83 commit 164bed5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030
*
3131
* <p>If the event is not published within the boundaries of a managed transaction, the event
3232
* is discarded unless the {@link #fallbackExecution} flag is explicitly set. If a
33-
* transaction is running, the event is processed according to its {@link TransactionPhase}.
33+
* transaction is running, the event is processed according to its {@code TransactionPhase}.
3434
*
3535
* <p>Adding {@link org.springframework.core.annotation.Order @Order} on your annotated method
3636
* allows you to prioritize that listener amongst other listeners running in the same phase.
3737
*
3838
* @author Stephane Nicoll
39+
* @author Sam Brannen
3940
* @since 4.2
4041
*/
4142
@EventListener
@@ -59,16 +60,17 @@
5960
/**
6061
* Alias for {@link #classes}.
6162
*/
62-
@AliasFor("classes")
63+
@AliasFor(annotation = EventListener.class, attribute = "classes")
6364
Class<?>[] value() default {};
6465

6566
/**
6667
* The event classes that this listener handles.
67-
* <p>When this attribute is specified with one value, the method parameter
68-
* may or may not be specified. When this attribute is specified with more
69-
* than one value, the method must not have a parameter.
68+
* <p>If this attribute is specified with a single value, the annotated
69+
* method may optionally accept a single parameter. However, if this
70+
* attribute is specified with multiple values, the annotated method
71+
* must <em>not</em> declare any parameters.
7072
*/
71-
@AliasFor("value")
73+
@AliasFor(annotation = EventListener.class, attribute = "classes")
7274
Class<?>[] classes() default {};
7375

7476
/**

0 commit comments

Comments
 (0)