org.jboss.modules
Class LocalModuleLoader

java.lang.Object
  extended by org.jboss.modules.ModuleLoader
      extended by org.jboss.modules.LocalModuleLoader

public final class LocalModuleLoader
extends ModuleLoader

A local filesystem-backed module loader.

Author:
John Bailey, David M. Lloyd

Constructor Summary
LocalModuleLoader()
          Construct a new instance, using the module.path system property or the MODULEPATH environment variable to get the list of module repository roots.
LocalModuleLoader(File[] repoRoots)
          Construct a new instance.
LocalModuleLoader(File[] repoRoots, PathFilter pathFilter)
          Construct a new instance.
 
Method Summary
protected  ModuleSpec findModule(ModuleIdentifier moduleIdentifier)
          Find a Module's specification in this ModuleLoader by its identifier.
protected  Module preloadModule(ModuleIdentifier identifier)
          Preload a module based on an identifier.
 String toString()
          Get the string representation of this module loader.
 
Methods inherited from class org.jboss.modules.ModuleLoader
findLoadedModuleLocal, forClass, forClassLoader, loadModule, loadModuleLocal, preloadExportedModule, preloadModule, refreshResourceLoaders, relink, setAndRefreshResourceLoaders, setAndRelinkDependencies, unloadModuleLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalModuleLoader

public LocalModuleLoader(File[] repoRoots)
Construct a new instance.

Parameters:
repoRoots - the array of repository roots to look for modules

LocalModuleLoader

public LocalModuleLoader(File[] repoRoots,
                         PathFilter pathFilter)
Construct a new instance.

Parameters:
repoRoots - the array of repository roots to look for modules
pathFilter - the path filter to apply to roots

LocalModuleLoader

public LocalModuleLoader()
Construct a new instance, using the module.path system property or the MODULEPATH environment variable to get the list of module repository roots.

Method Detail

preloadModule

protected Module preloadModule(ModuleIdentifier identifier)
                        throws ModuleLoadException
Preload a module based on an identifier. By default, no delegation is done and this method simply invokes ModuleLoader.loadModuleLocal(ModuleIdentifier). A delegating module loader may delegate to the appropriate module loader based on loader-specific criteria (via the ModuleLoader.preloadModule(ModuleIdentifier, ModuleLoader) method).

Overrides:
preloadModule in class ModuleLoader
Parameters:
identifier - the module identifier
Returns:
the load result, or null if the module is not found
Throws:
ModuleLoadException - if an error occurs

findModule

protected ModuleSpec findModule(ModuleIdentifier moduleIdentifier)
                         throws ModuleLoadException
Find a Module's specification in this ModuleLoader by its identifier. This should be overriden by sub-classes to implement the Module loading strategy for this loader.

If no module is found in this module loader with the given identifier, then this method should return null. If the module is found but some problem occurred (for example, a transitive dependency failed to load) then this method should throw a ModuleLoadException of the relevant type.

Specified by:
findModule in class ModuleLoader
Parameters:
moduleIdentifier - The modules Identifier
Returns:
the module specification, or null if no module is found with the given identifier
Throws:
ModuleLoadException - if any problems occur finding the module

toString

public String toString()
Description copied from class: ModuleLoader
Get the string representation of this module loader.

Specified by:
toString in class ModuleLoader
Returns:
the string representation


Copyright © 2011. All Rights Reserved.