Package org.jboss.modules

# Class ResourceLoaderModuleFinder

java.lang.Object
org.jboss.modules.ResourceLoaderModuleFinder

All Implemented Interfaces:
  `ModuleFinder`

public final class ResourceLoaderModuleFinder extends Object implements ModuleFinder
A module loader which loads modules which are stored inside the `modules` directory of a single JAR or JAR-like root.

## Constructor Summary

Constructors
Constructor
Description
`ResourceLoaderModuleFinder(ResourceLoader resourceLoader)`
Construct a new instance.
`ResourceLoaderModuleFinder(ResourceLoader resourceLoader, String modulesDirectory)`
Construct a new instance.

## Method Summary

Modifier and Type
Method
Description
`ModuleSpec`
`findModule(String name, ModuleLoader delegateLoader)`
Find a module specification for the given name.

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

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

### Methods inherited from interface org.jboss.modules.ModuleFinder

`findModule`

## Constructor Details

### ResourceLoaderModuleFinder

public ResourceLoaderModuleFinder(ResourceLoader resourceLoader, String modulesDirectory)
Construct a new instance. The given resource loader should support the nested `ResourceLoader.createSubloader(String, String)` operation if `&lt;resource-root&gt;` elements are to be supported in `module.xml` files found within the loader.

Parameters:
  `resourceLoader` - the base resource loader to use (must not be `null`)
  `modulesDirectory` - the modules directory to use (must not be `null`)

### ResourceLoaderModuleFinder

public ResourceLoaderModuleFinder(ResourceLoader resourceLoader)
Construct a new instance. The given resource loader should support the nested `ResourceLoader.createSubloader(String, String)` operation if `&lt;resource-root&gt;` elements are to be supported in `module.xml` files found within the loader.

Parameters:
  `resourceLoader` - the base resource loader to use (must not be `null`)

## Method Details

### findModule

public ModuleSpec findModule(String name, ModuleLoader delegateLoader) throws ModuleLoadException
Description copied from interface: `ModuleFinder`
Find a module specification for the given name. The default implementation delegates to the legacy `ModuleFinder.findModule(ModuleIdentifier, ModuleLoader)` method for now, however this behavior will be discontinued in the future.

Specified by:
  `findModule` in interface `ModuleFinder`
Parameters:
  `name` - the module name
  `delegateLoader` - the module loader from which dependencies should be resolved
Returns:
  the module specification, or `null` if no specification is found for this identifier
Throws:
  `ModuleLoadException`