Skip to content

Commit 6acef01

Browse files
authored
Introduce native hints for new Spring config import S3 solution (#1297)
1 parent ec21b01 commit 6acef01

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/ConfigStoreRuntimeHints.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
package io.awspring.cloud.autoconfigure.config;
1717

1818
import io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStorePropertySources;
19+
import io.awspring.cloud.autoconfigure.config.s3.S3PropertySources;
1920
import io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerPropertySources;
2021
import io.awspring.cloud.parameterstore.ParameterStorePropertySource;
22+
import io.awspring.cloud.s3.config.S3PropertySource;
2123
import io.awspring.cloud.secretsmanager.SecretsManagerPropertySource;
2224
import org.springframework.aot.hint.MemberCategory;
2325
import org.springframework.aot.hint.RuntimeHints;
@@ -48,5 +50,14 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
4850
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
4951
}
5052

53+
if (ClassUtils.isPresent("io.awspring.cloud.s3.S3PropertySource", classLoader)) {
54+
hints.reflection().registerType(TypeReference.of(S3PropertySources.class),
55+
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
56+
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
57+
58+
hints.reflection().registerType(TypeReference.of(S3PropertySource.class),
59+
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
60+
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
61+
}
5162
}
5263
}

0 commit comments

Comments
 (0)