Class DelegatingModuleLoader

java.lang.Object
org.jboss.modules.ModuleLoader
org.jboss.modules.DelegatingModuleLoader
Direct Known Subclasses:
LocalModuleLoader

public class DelegatingModuleLoader extends ModuleLoader
A module loader which searches its finders first, and then delegates to another loader if the module is not found.
  • Constructor Details

    • DelegatingModuleLoader

      public DelegatingModuleLoader(ModuleLoader delegate, ModuleFinder[] finders)
      Construct a new instance.
      Parameters:
      delegate - the delegate module loader, or null to skip delegation
      finders - the module finders (must not be null)
    • DelegatingModuleLoader

      public DelegatingModuleLoader(ModuleLoader delegate, ModuleFinder finder)
      Construct a new instance.
      Parameters:
      delegate - the delegate module loader, or null to skip delegation
      finder - the single module finder (must not be null)
  • Method Details

    • preloadModule

      protected Module preloadModule(String name) throws ModuleLoadException
      Preload the named module.
      Overrides:
      preloadModule in class ModuleLoader
      Parameters:
      name - the module name (must not be null)
      Returns:
      the loaded module, or null if it is not found in this loader or the delegate
      Throws:
      ModuleLoadException - if the module was found but failed to be loaded