From a06f39b76d3479a28b8d3cf93904af8a3e37b850 Mon Sep 17 00:00:00 2001 From: Ludovic Bertin Date: Tue, 25 Feb 2025 08:33:57 +0100 Subject: [PATCH] Add AOT runtime hints for core listeners Signed-off-by: Ludovic Bertin --- .../batch/core/aot/CoreRuntimeHints.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java b/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java index 84a3c6e88..5c818578c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,6 +98,27 @@ public class CoreRuntimeHints implements RuntimeHintsRegistrar { // proxy hints hints.proxies() + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.StepExecutionListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.ItemReadListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.ItemProcessListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.ItemWriteListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.ChunkListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.SkipListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) + .registerJdkProxy(builder -> builder + .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.JobExecutionListener")) + .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)) .registerJdkProxy(builder -> builder .proxiedInterfaces(TypeReference.of("org.springframework.batch.core.repository.JobRepository")) .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class))