Package org.jboss.modules

# 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.

## Field Summary

### Fields inherited from class org.jboss.modules.ModuleLoader

`NO_FINDERS`

## Constructor Summary

Constructors
Constructor
Description
`DelegatingModuleLoader(ModuleLoader delegate, ModuleFinder finder)`
Construct a new instance.
`DelegatingModuleLoader(ModuleLoader delegate, ModuleFinder[] finders)`
Construct a new instance.

## Method Summary

Modifier and Type
Method
Description
`protected Module`
`preloadModule(String name)`
Preload the named module.

### Methods inherited from class org.jboss.modules.ModuleLoader

`findLoadedModuleLocal, findLoadedModuleLocal, findModule, findModule, forClass, forClassLoader, getDependencies, getFinders, getModuleDescription, installMBeanServer, iterateModules, iterateModules, loadModule, loadModule, loadModuleLocal, loadModuleLocal, preloadExportedModule, preloadExportedModule, preloadModule, preloadModule, preloadModule, refreshResourceLoaders, relink, setAndRefreshResourceLoaders, setAndRelinkDependencies, toString, unloadModuleLocal, unloadModuleLocal`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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