Package org.jboss.modules
Class ClassPathModuleLoader
- java.lang.Object
-
- org.jboss.modules.ModuleLoader
-
- org.jboss.modules.ClassPathModuleLoader
-
final class ClassPathModuleLoader extends ModuleLoader
Date: 06.05.2011
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.modules.ModuleLoader
ModuleLoader.MXBeanImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringclassPathprivate ModuleLoaderdelegateLoaderprivate java.lang.Stringdependenciesprivate java.lang.StringmainClass(package private) static java.lang.String[]NO_STRINGS-
Fields inherited from class org.jboss.modules.ModuleLoader
NO_FINDERS
-
-
Constructor Summary
Constructors Constructor Description ClassPathModuleLoader(ModuleLoader delegateLoader, java.lang.String mainClass, java.lang.String classPath, java.lang.String dependencies)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddClassPath(ModuleSpec.Builder builder, java.lang.String classPath)Adds the class path entries as dependencies on the builder.protected ModuleSpecfindModule(ModuleIdentifier moduleIdentifier)Find a Module's specification in this ModuleLoader by its identifier.private static booleanisEmpty(java.lang.String classPath)protected ModulepreloadModule(ModuleIdentifier identifier)Preload a module based on an identifier.java.lang.StringtoString()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 Detail
-
NO_STRINGS
static final java.lang.String[] NO_STRINGS
-
delegateLoader
private final ModuleLoader delegateLoader
-
classPath
private final java.lang.String classPath
-
dependencies
private final java.lang.String dependencies
-
mainClass
private final java.lang.String mainClass
-
-
Constructor Detail
-
ClassPathModuleLoader
ClassPathModuleLoader(ModuleLoader delegateLoader, java.lang.String mainClass, java.lang.String classPath, java.lang.String dependencies)
-
-
Method Detail
-
isEmpty
private static boolean isEmpty(java.lang.String classPath)
-
preloadModule
protected Module preloadModule(ModuleIdentifier identifier) throws ModuleLoadException
Description copied from class:ModuleLoaderPreload 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:
preloadModulein classModuleLoader- Parameters:
identifier- the module identifier- Returns:
- the load result, or
nullif the module is not found - Throws:
ModuleLoadException- if an error occurs
-
findModule
protected ModuleSpec findModule(ModuleIdentifier moduleIdentifier) throws ModuleLoadException
Description copied from class:ModuleLoaderFind 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 aModuleLoadExceptionof the relevant type.- Overrides:
findModulein classModuleLoader- Parameters:
moduleIdentifier- the module identifier- Returns:
- the module specification, or
nullif no module is found with the given identifier - Throws:
ModuleLoadException- if any problems occur finding the module
-
toString
public java.lang.String toString()
Description copied from class:ModuleLoaderGet the string representation of this module loader.- Overrides:
toStringin classModuleLoader- Returns:
- the string representation
-
addClassPath
private void addClassPath(ModuleSpec.Builder builder, java.lang.String classPath) throws ModuleLoadException
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.
-
-