Skip to content

Commit 12cad57

Browse files
committed
fix: RetryTemplate aot hints
1 parent b98b2a5 commit 12cad57

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162

163163
<build>
164164
<resources>
165+
<resource>
166+
<directory>src/main/resources</directory>
167+
</resource>
165168
<resource>
166169
<directory>.</directory>
167170
<targetPath>META-INF</targetPath>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.springframework.retry.aot;
2+
3+
import org.springframework.aot.hint.MemberCategory;
4+
import org.springframework.aot.hint.RuntimeHints;
5+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
6+
import org.springframework.aot.hint.TypeReference;
7+
import org.springframework.retry.support.RetryTemplate;
8+
9+
/**
10+
* The retry runtime hints to be used for aot builds.
11+
*
12+
* @author Tobias Soloschenko
13+
*/
14+
class RetryHints implements RuntimeHintsRegistrar {
15+
16+
@Override
17+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
18+
hints.reflection()
19+
.registerType(TypeReference.of(RetryTemplate.class),
20+
hint -> hint.withMembers(MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS,
21+
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INTROSPECT_DECLARED_METHODS,
22+
MemberCategory.INVOKE_DECLARED_METHODS));
23+
}
24+
25+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2+
org.springframework.retry.aot.RetryHints

0 commit comments

Comments
 (0)