Move hint for Flux using registerTypeIfAvailable

This commit is contained in:
Soby Chacko
2022-11-17 15:35:33 -05:00
parent 3ffb52e22c
commit 0a6808441b

View File

@@ -41,8 +41,6 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.lang.Nullable;
import reactor.core.publisher.Flux;
/**
* {@link RuntimeHintsRegistrar} for Spring for Apache Pulsar.
*
@@ -61,7 +59,7 @@ public class PulsarRuntimeHints implements RuntimeHintsRegistrar {
Stream.of(HashSet.class, TreeMap.class, Authentication.class, AuthenticationDataProvider.class,
SecretsSerializer.class, NioSocketChannel.class, AbstractByteBufAllocator.class,
NioDatagramChannel.class, PulsarAdminBuilderImpl.class, OffloadProcessStatusImpl.class, Commands.class,
ReferenceCountUtil.class, Flux.class).forEach(
ReferenceCountUtil.class).forEach(
type -> reflectionHints.registerType(type,
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS,
@@ -88,8 +86,8 @@ public class PulsarRuntimeHints implements RuntimeHintsRegistrar {
.forEach(typeName -> reflectionHints.registerTypeIfPresent(classLoader, typeName,
MemberCategory.DECLARED_FIELDS));
// Dynamic components that need hints with constructor and method level access.
Stream.of("com.github.benmanes.caffeine.cache.SSMSA", "com.github.benmanes.caffeine.cache.PSAMS")
Stream.of("reactor.core.publisher.Flux", "com.github.benmanes.caffeine.cache.SSMSA",
"com.github.benmanes.caffeine.cache.PSAMS")
.forEach(typeName -> reflectionHints.registerTypeIfPresent(classLoader, typeName,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS,
MemberCategory.INTROSPECT_PUBLIC_METHODS));