Interface ModuleDependentModuleInitializer<E extends ModuleInitializer>

Type Parameters:
E - the entrypoint type of the module being depended on
All Known Subinterfaces:
CLIModuleDependentModuleInitializer, GLFWRenderModuleDependentModuleInitializer, RenderModuleDependentModuleInitializer, SimulatorModuleDependentModuleInitializer, VulkanGLFWRenderModuleDependentModuleInitializer, VulkanModuleDependentModuleInitializer, VulkanRenderModuleDependentModuleInitializer, WebserverModuleDependentModuleInitializer
All Known Implementing Classes:
GLFWRenderModuleDependentVulkanGLFWRenderModuleEntrypoint, RenderModuleDependentGLFWRenderModuleEntrypoint, RenderModuleDependentVulkanGLFWRenderModuleEntrypoint, RenderModuleDependentVulkanRenderModuleEntrypoint, VulkanModuleDependentVulkanGLFWRenderModuleEntrypoint, VulkanModuleDependentVulkanRenderModuleEntrypoint, VulkanRenderModuleDependentVulkanGLFWRenderModuleEntrypoint

public interface ModuleDependentModuleInitializer<E extends ModuleInitializer>
The callback by which one module learns of another module it depends on.

Each module extends this with a named interface of its own, and any module depending on that module registers an implementation of it. When the depended-on module finishes loading its configuration, it invokes every such implementation, passing itself. The implementation's job is to hand that entrypoint to its own module, by transferring it into that module's dependency queue:

MainModuleEngine.getInstance().getCurvedSpacetimeLoader()
        .getEntrypoints("main", ModuleInitializer.class).stream()
        .filter(MyModuleEntrypoint.class::isInstance)
        .findFirst().orElseThrow()
        .getDependencyModuleTransferQueue().transfer(moduleEntrypoint);

Implementations must satisfy requirements R17 through R19 and R25 of the Module System Specification.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onInitialize(E moduleEntrypoint)
    Receives the entrypoint of a module this module depends on.
  • Method Details

    • onInitialize

      void onInitialize(E moduleEntrypoint)
      Receives the entrypoint of a module this module depends on.

      Called on the depended-on module's initialization thread, not this module's.

      Parameters:
      moduleEntrypoint - the entrypoint of the module being depended on