Package org.jboss.modules
Class ClassPathModuleLoader
java.lang.Object
org.jboss.modules.ModuleLoader
org.jboss.modules.ClassPathModuleLoader
Date: 06.05.2011
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.modules.ModuleLoader
ModuleLoader.MXBeanImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final ModuleLoader
private final String
private final String
(package private) static final String[]
Fields inherited from class org.jboss.modules.ModuleLoader
NO_FINDERS
-
Constructor Summary
ConstructorsConstructorDescriptionClassPathModuleLoader
(ModuleLoader delegateLoader, String mainClass, String classPath, String dependencies) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addClassPath
(ModuleSpec.Builder builder, String classPath) Adds the class path entries as dependencies on the builder.protected ModuleSpec
findModule
(ModuleIdentifier moduleIdentifier) Find a Module's specification in this ModuleLoader by its identifier.private static boolean
protected Module
preloadModule
(ModuleIdentifier identifier) Preload a module based on an identifier.toString()
Get the string representation of this module loader.Methods inherited from class org.jboss.modules.ModuleLoader
addClassLoadTime, addLinkTime, findLoadedModuleLocal, forClass, forClassLoader, getDependencies, getFinders, incClassCount, incRaceCount, incScanCount, installMBeanServer, iterateModules, loadModule, loadModuleLocal, preloadExportedModule, preloadModule, refreshResourceLoaders, relink, setAndRefreshResourceLoaders, setAndRelinkDependencies, unloadModuleLocal
-
Field Details
-
NO_STRINGS
-
delegateLoader
-
classPath
-
dependencies
-
mainClass
-
-
Constructor Details
-
ClassPathModuleLoader
ClassPathModuleLoader(ModuleLoader delegateLoader, String mainClass, String classPath, String dependencies)
-
-
Method Details
-
isEmpty
-
preloadModule
Description copied from class:ModuleLoader
Preload a module based on an identifier. By default, no delegation is done and this method simply invokesModuleLoader.loadModuleLocal(ModuleIdentifier)
. A delegating module loader may delegate to the appropriate module loader based on loader-specific criteria (via theModuleLoader.preloadModule(ModuleIdentifier, ModuleLoader)
method).- Overrides:
preloadModule
in classModuleLoader
- Parameters:
identifier
- the module identifier- Returns:
- the load result, or
null
if the module is not found - Throws:
ModuleLoadException
- if an error occurs
-
findModule
Description copied from class:ModuleLoader
Find a Module's specification in this ModuleLoader by its identifier. This can be overriden by sub-classes to implement the Module loading strategy for this loader. The default implementation iterates the module finders provided during construction. If no module is found in this module loader with the given identifier, then this method should returnnull
. If the module is found but some problem occurred (for example, a transitive dependency failed to load) then this method should throw aModuleLoadException
of the relevant type.- Overrides:
findModule
in classModuleLoader
- Parameters:
moduleIdentifier
- the module 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
Description copied from class:ModuleLoader
Get the string representation of this module loader.- Overrides:
toString
in classModuleLoader
- Returns:
- the string representation
-
addClassPath
Adds the class path entries as dependencies on the builder.- Parameters:
builder
- the builder to add the dependency entries to.classPath
- the class path to process- Throws:
ModuleLoadException
- if the class path entry is not found or the entry is a directory.
-