Skip to content

Commit

Permalink
Introduce native hints for new Spring config import S3 solution (awsp…
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejNedic authored Dec 17, 2024
1 parent ec21b01 commit 6acef01
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
package io.awspring.cloud.autoconfigure.config;

import io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStorePropertySources;
import io.awspring.cloud.autoconfigure.config.s3.S3PropertySources;
import io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerPropertySources;
import io.awspring.cloud.parameterstore.ParameterStorePropertySource;
import io.awspring.cloud.s3.config.S3PropertySource;
import io.awspring.cloud.secretsmanager.SecretsManagerPropertySource;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
Expand Down Expand Up @@ -48,5 +50,14 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
}

if (ClassUtils.isPresent("io.awspring.cloud.s3.S3PropertySource", classLoader)) {
hints.reflection().registerType(TypeReference.of(S3PropertySources.class),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));

hints.reflection().registerType(TypeReference.of(S3PropertySource.class),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS));
}
}
}

0 comments on commit 6acef01

Please sign in to comment.