Skip to content

Commit d0afbe4

Browse files
committed
Tag EventListener as a reflective operation
This commit adds compatibility of declarative event listeners in a native image. See gh-28475
1 parent 4cca190 commit d0afbe4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-context/src/main/java/org/springframework/context/event/EventListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import java.lang.annotation.Target;
2424
import java.util.function.Predicate;
2525

26+
import org.springframework.aot.hint.annotation.Reflective;
2627
import org.springframework.context.ApplicationEvent;
2728
import org.springframework.core.annotation.AliasFor;
2829

@@ -89,6 +90,7 @@
8990
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
9091
@Retention(RetentionPolicy.RUNTIME)
9192
@Documented
93+
@Reflective
9294
public @interface EventListener {
9395

9496
/**

0 commit comments

Comments
 (0)