Skip to content

Commit e4190c4

Browse files
committed
GH-346 - Allow explicit declaration of identifier in @ApplicationModuleListener.
1 parent e5ca4f7 commit e4190c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/ApplicationModuleListener.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.lang.annotation.RetentionPolicy;
2222
import java.lang.annotation.Target;
2323

24+
import org.springframework.context.event.EventListener;
2425
import org.springframework.core.annotation.AliasFor;
2526
import org.springframework.scheduling.annotation.Async;
2627
import org.springframework.transaction.annotation.Propagation;
@@ -54,4 +55,15 @@
5455
*/
5556
@AliasFor(annotation = Transactional.class, attribute = "readOnly")
5657
boolean readOnlyTransaction() default false;
58+
59+
/**
60+
* An optional identifier for the listener, defaulting to the fully-qualified signature of the declaring method (e.g.
61+
* "mypackage.MyClass.myMethod()").
62+
*
63+
* @since 1.1
64+
* @see EventListener#id
65+
* @see org.springframework.transaction.event.TransactionalApplicationListener#getListenerId()
66+
*/
67+
@AliasFor(annotation = EventListener.class, attribute = "id")
68+
String id() default "";
5769
}

0 commit comments

Comments
 (0)