Class CurvedSpacetimeLoaderQuiltLoader
- All Implemented Interfaces:
CurvedSpacetimeLoader
Where the closed-world loader hard-codes its entrypoints so a native image can reach them, this
one discovers modules at run time: Quilt reads each module's quilt.mod.json, resolves
dependencies, and holds the entrypoint registry that the methods here read from. That makes the
Quilt variant the extensible one — modules can be dropped in without rebuilding — at the cost of
needing the loader present at run time.
- See Also:
-
Constructor Summary
Constructors -
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 entrypointCurvedSpacetimeLoader.getEntrypoints(String, Class)would return for the same arguments.voidprepareModInit(Path path, Object engine) Prepares this loader for module initialization.
-
Constructor Details
-
CurvedSpacetimeLoaderQuiltLoader
public CurvedSpacetimeLoaderQuiltLoader()Creates the loader.Holds no state of its own; every lookup is delegated to Quilt Loader.
-
-
Method Details
-
prepareModInit
Description copied from interface:CurvedSpacetimeLoaderPrepares this loader for module initialization.The engine calls this exactly once, before invoking any entrypoint. An implementation must retain
enginesuch thatCurvedSpacetimeLoader.getEngine()returns it thereafter.- Specified by:
prepareModInitin interfaceCurvedSpacetimeLoader- Parameters:
path- the run directory modules resolve their resources againstengine- the engine driving initialization
-
getEntrypoints
Description copied from interface:CurvedSpacetimeLoaderReturns 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.
- Specified by:
getEntrypointsin interfaceCurvedSpacetimeLoader- 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
-
invokeEntrypoints
public <E> void invokeEntrypoints(String name, Class<E> moduleInitializerClass, Consumer<? super E> moduleInitializerConsumer) Description copied from interface:CurvedSpacetimeLoaderApplies the given consumer to every entrypointCurvedSpacetimeLoader.getEntrypoints(String, Class)would return for the same arguments.No ordering is imposed, and callers must not depend on one.
- Specified by:
invokeEntrypointsin interfaceCurvedSpacetimeLoader- 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
-
getEngine
Description copied from interface:CurvedSpacetimeLoaderReturns the engine this loader was prepared with.- Specified by:
getEnginein interfaceCurvedSpacetimeLoader- Returns:
- the engine passed to
CurvedSpacetimeLoader.prepareModInit(Path, Object), ornullbefore that call
-