Add native reflection hints for Job/Step contexts

This commit is contained in:
Mahmoud Ben Hassine
2022-11-04 11:21:37 +01:00
parent 5da133ac36
commit bc92c4a1da

View File

@@ -23,6 +23,8 @@ import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.batch.core.scope.context.JobContext;
import org.springframework.batch.core.scope.context.StepContext;
import org.springframework.core.DecoratingProxy;
/**
@@ -58,6 +60,9 @@ public class CoreRuntimeHints implements RuntimeHintsRegistrar {
.proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class));
hints.reflection().registerType(Types.class, MemberCategory.DECLARED_FIELDS);
hints.reflection().registerType(JobContext.class, MemberCategory.INVOKE_PUBLIC_METHODS);
hints.reflection().registerType(StepContext.class, MemberCategory.INVOKE_PUBLIC_METHODS);
}
}