This commit is contained in:
Stephane Nicoll
2022-06-09 15:12:38 +02:00
parent 363722893b
commit 1e5f4f8b44

View File

@@ -19,14 +19,16 @@ package org.springframework.aot.hint;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
* Contract for registering {@link RuntimeHints} in a static fashion. * Contract for registering {@link RuntimeHints} based on the {@link ClassLoader}
* <p>Implementations will contribute hints without any knowledge of the application context * of the deployment unit. Implementations should, if possible, use the specified
* and can only use the given {@link ClassLoader} to conditionally contribute hints. * {@link ClassLoader} to determine if hints have to be contributed.
* <p>{@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. * <p>Implementations of this interface can be registered statically in
* A standard no-arg constructor is required for implementations. * {@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 Brian Clozel
* @author Stephane Nicoll
* @since 6.0 * @since 6.0
*/ */
@FunctionalInterface @FunctionalInterface
@@ -34,7 +36,7 @@ public interface RuntimeHintsRegistrar {
/** /**
* Contribute hints to the given {@link RuntimeHints} instance. * 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 * @param classLoader the classloader, or {@code null} if even the system ClassLoader isn't accessible
*/ */
void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader); void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader);