diff --git a/spring-core/src/main/java/org/springframework/aot/hint/RuntimeHintsRegistrar.java b/spring-core/src/main/java/org/springframework/aot/hint/RuntimeHintsRegistrar.java index 0b764858e10..fac74245c1a 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/RuntimeHintsRegistrar.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/RuntimeHintsRegistrar.java @@ -19,14 +19,16 @@ package org.springframework.aot.hint; import org.springframework.lang.Nullable; /** - * Contract for registering {@link RuntimeHints} in a static fashion. - *

Implementations will contribute hints without any knowledge of the application context - * and can only use the given {@link ClassLoader} to conditionally contribute hints. - *

{@code RuntimeHintsRegistrar} can be declared as {@code spring/aot.factories} entries; - * the registrar will be processed as soon as its declaration is found in the classpath. - * A standard no-arg constructor is required for implementations. + * Contract for registering {@link RuntimeHints} based on the {@link ClassLoader} + * of the deployment unit. Implementations should, if possible, use the specified + * {@link ClassLoader} to determine if hints have to be contributed. + * + *

Implementations of this interface can be registered statically in + * {@code META-INF/spring/aot.factories} by using the FQN of this interface as + * the key. A standard no-arg constructor is required for implementations. * * @author Brian Clozel + * @author Stephane Nicoll * @since 6.0 */ @FunctionalInterface @@ -34,7 +36,7 @@ public interface RuntimeHintsRegistrar { /** * Contribute hints to the given {@link RuntimeHints} instance. - * @param hints the hints contributed so far for the application + * @param hints the hints contributed so far for the deployment unit * @param classLoader the classloader, or {@code null} if even the system ClassLoader isn't accessible */ void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader);