Class LocalModuleFinder
java.lang.Object
org.jboss.modules.LocalModuleFinder
- All Implemented Interfaces:
ModuleFinder
A module finder which locates module specifications which are stored in a local module
repository on the filesystem, which uses
module.xml descriptors.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AccessControlContextprivate static final File[]private final PathFilterprivate final File[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstruct a new instance, using themodule.pathsystem property or theJAVA_MODULEPATHenvironment variable to get the list of module repository roots.LocalModuleFinder(boolean supportLayersAndAddOns) Construct a new instance, using themodule.pathsystem property or theJAVA_MODULEPATHenvironment variable to get the list of module repository roots.LocalModuleFinder(File[] repoRoots) Construct a new instance.LocalModuleFinder(File[] repoRoots, PathFilter pathFilter) Construct a new instance.privateLocalModuleFinder(File[] repoRoots, PathFilter pathFilter, boolean cloneRoots) -
Method Summary
Modifier and TypeMethodDescriptionfindModule(ModuleIdentifier identifier, ModuleLoader delegateLoader) Find a module specification for the given identifier.private static File[]private static File[](package private) static File[]getRepoRoots(boolean supportLayersAndAddOns) static ModuleSpecparseModuleXmlFile(ModuleIdentifier identifier, ModuleLoader delegateLoader, File... roots) Parse amodule.xmlfile and return the corresponding module specification.private static StringtoPathString(ModuleIdentifier moduleIdentifier) toString()
-
Field Details
-
NO_FILES
-
repoRoots
-
pathFilter
-
accessControlContext
-
-
Constructor Details
-
LocalModuleFinder
-
LocalModuleFinder
Construct a new instance.- Parameters:
repoRoots- the repository roots to usepathFilter- the path filter to use
-
LocalModuleFinder
Construct a new instance.- Parameters:
repoRoots- the repository roots to use
-
LocalModuleFinder
public LocalModuleFinder()Construct a new instance, using themodule.pathsystem property or theJAVA_MODULEPATHenvironment variable to get the list of module repository roots.This is equivalent to a call to
LocalModuleFinder(true). -
LocalModuleFinder
public LocalModuleFinder(boolean supportLayersAndAddOns) Construct a new instance, using themodule.pathsystem property or theJAVA_MODULEPATHenvironment variable to get the list of module repository roots.- Parameters:
supportLayersAndAddOns-trueif the identified module repository roots should be checked for an internal structure of child "layer" and "add-on" directories that may also be treated as module roots lower in precedence than the parent root. Any "layers" subdirectories whose names are specified in alayers.conffile found in the module repository root will be added in the precedence of order specified in thelayers.conffile; all "add-on" subdirectories will be added at a lower precedence than all "layers" and with no guaranteed precedence order between them. Iffalseno check for "layer" and "add-on" directories will be performed.
-
-
Method Details
-
getRepoRoots
-
getModulePathFiles
-
getFiles
-
toPathString
-
findModule
public ModuleSpec findModule(ModuleIdentifier identifier, ModuleLoader delegateLoader) throws ModuleLoadException Description copied from interface:ModuleFinderFind a module specification for the given identifier.- Specified by:
findModulein interfaceModuleFinder- Parameters:
identifier- the module identifierdelegateLoader- the module loader from which dependencies should be resolved- Returns:
- the module specification, or
nullif no specification is found for this identifier - Throws:
ModuleLoadException
-
parseModuleXmlFile
public static ModuleSpec parseModuleXmlFile(ModuleIdentifier identifier, ModuleLoader delegateLoader, File... roots) throws IOException, ModuleLoadException Parse amodule.xmlfile and return the corresponding module specification.- Parameters:
identifier- the identifier to loaddelegateLoader- the delegate module loader to use for module specificationsroots- the repository root paths to search- Returns:
- the module specification
- Throws:
IOException- if reading the module file failedModuleLoadException- if creating the module specification failed (e.g. due to a parse error)
-
toString
-