Interface CurvedSpacetimeLoader
- All Known Implementing Classes:
CurvedSpacetimeLoaderClosedLoader, CurvedSpacetimeLoaderQuiltLoader
An implementation is free to resolve entrypoints however it likes. The closed-world loader holds them in static tables so that GraalVM native-image can reach them by ordinary static analysis; the Quilt loader delegates to Quilt Loader, which discovers them dynamically. Neither strategy is privileged by this interface.
Implementations must satisfy requirements R6 through R11 of the Module System Specification.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the engine this loader was prepared with.<E> List<E> getEntrypoints(String name, Class<E> moduleInitializerClass) Returns every entrypoint registered under the given name whose runtime type is assignable tomoduleInitializerClass.<E> voidinvokeEntrypoints(String name, Class<E> moduleInitializerClass, Consumer<? super E> moduleInitializerConsumer) Applies the given consumer to every entrypointgetEntrypoints(String, Class)would return for the same arguments.voidprepareModInit(Path path, Object engine) Prepares this loader for module initialization.
-
Method Details
-
prepareModInit
Prepares this loader for module initialization.The engine calls this exactly once, before invoking any entrypoint. An implementation must retain
enginesuch thatgetEngine()returns it thereafter.- Parameters:
path- the run directory modules resolve their resources againstengine- the engine driving initialization
-
getEntrypoints
Returns every entrypoint registered under the given name whose runtime type is assignable tomoduleInitializerClass.An implementation returns the same instances across repeated calls within one run. The dependency handshake relies on that: a dependent locates its own main entrypoint by filtering this list, then transfers to the queue owned by that exact object.
- Type Parameters:
E- the entrypoint type- Parameters:
name- the entrypoint name, such asmainmoduleInitializerClass- the type registered entrypoints must be assignable to- Returns:
- the matching entrypoints, empty when the name is recognised but nothing is registered
- Throws:
IllegalArgumentException- if the entrypoint name is not recognised
-
invokeEntrypoints
<E> void invokeEntrypoints(String name, Class<E> moduleInitializerClass, Consumer<? super E> moduleInitializerConsumer) Applies the given consumer to every entrypointgetEntrypoints(String, Class)would return for the same arguments.No ordering is imposed, and callers must not depend on one.
- Type Parameters:
E- the entrypoint type- Parameters:
name- the entrypoint name, such asmainmoduleInitializerClass- the type registered entrypoints must be assignable tomoduleInitializerConsumer- the action to apply to each entrypoint- Throws:
IllegalArgumentException- if the entrypoint name is not recognised
-
getEngine
Object getEngine()Returns the engine this loader was prepared with.- Returns:
- the engine passed to
prepareModInit(Path, Object), ornullbefore that call
-