Package com.sun.enterprise.module.single
Class ClassPathBasedModulesRegistry
- java.lang.Object
-
- com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
-
- com.sun.enterprise.module.impl.ModulesRegistryImpl
-
- com.sun.enterprise.module.single.ClassPathBasedModulesRegistry
-
- All Implemented Interfaces:
ModuleChangeListener
,ModulesRegistry
public class ClassPathBasedModulesRegistry extends ModulesRegistryImpl
Implements a modules registry based on a class-path style of module description using a single class loader (capable of loading the entire class-path)
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.ClassLoader
cLoader
(package private) java.util.List<ModuleDefinition>
moduleDefs
(package private) java.util.List<Module>
modules
-
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
parent, providers, repositories
-
-
Constructor Summary
Constructors Constructor Description ClassPathBasedModulesRegistry(java.lang.ClassLoader singleCL, java.lang.String classPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Module
find(java.lang.Class clazz)
Finds theModule
that owns the given class.java.util.Collection<Module>
getModules()
Returns the list of shared Modules registered in this instance.java.util.Collection<Module>
getModules(java.lang.String moduleName)
Returns the list of shared Modules registered in this instance whose name matches the given nameModule
makeModuleFor(java.lang.String name, java.lang.String version, boolean resolve)
Returns theModule
instance giving a name and version constraints.protected java.util.List<ActiveDescriptor>
parseInhabitants(Module module, java.lang.String name, ServiceLocator serviceLocator, java.util.List<PopulatorPostProcessor> postProcessors)
-
Methods inherited from class com.sun.enterprise.module.impl.ModulesRegistryImpl
createChild, detachAll, getLifecycleListeners, getModulesClassLoader, getModulesClassLoader, getParentClassLoader, getProvidingModule, newModule, register, setParentClassLoader, shutdown, unregister
-
Methods inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
add, add, add, addRepository, addRepository, changed, createServiceLocator, createServiceLocator, createServiceLocator, dumpState, getAllServiceLocators, getModulesProvider, getProvidersClass, getRepository, getRunningServices, initializeServiceLocator, loadFromRepository, makeModuleFor, makeModuleFor, newServiceLocator, newServiceLocator, populateConfig, populateServiceLocator, print, registerRunningService, remove, removeRepository, unregisterRunningService
-
-
-
-
Field Detail
-
cLoader
final java.lang.ClassLoader cLoader
-
moduleDefs
final java.util.List<ModuleDefinition> moduleDefs
-
modules
final java.util.List<Module> modules
-
-
Method Detail
-
find
public Module find(java.lang.Class clazz)
Description copied from interface:ModulesRegistry
Finds theModule
that owns the given class.- Specified by:
find
in interfaceModulesRegistry
- Overrides:
find
in classModulesRegistryImpl
- Returns:
- null if the class is loaded outside the module system.
-
getModules
public java.util.Collection<Module> getModules(java.lang.String moduleName)
Description copied from interface:ModulesRegistry
Returns the list of shared Modules registered in this instance whose name matches the given nameThe returned list will not include the modules defined in the ancestor
ModulesRegistry
s.- Specified by:
getModules
in interfaceModulesRegistry
- Overrides:
getModules
in classAbstractModulesRegistryImpl
- Returns:
- an umodifiable list of loaded modules having names that match the given name
-
getModules
public java.util.Collection<Module> getModules()
Description copied from class:AbstractModulesRegistryImpl
Returns the list of shared Modules registered in this instance.The returned list will not include the modules defined in the ancestor
AbstractModulesRegistryImpl
s.- Specified by:
getModules
in interfaceModulesRegistry
- Overrides:
getModules
in classAbstractModulesRegistryImpl
- Returns:
- an umodifiable list of loaded modules
-
makeModuleFor
public Module makeModuleFor(java.lang.String name, java.lang.String version, boolean resolve) throws ResolveError
Description copied from interface:ModulesRegistry
Returns theModule
instance giving a name and version constraints.- Specified by:
makeModuleFor
in interfaceModulesRegistry
- Overrides:
makeModuleFor
in classAbstractModulesRegistryImpl
- Parameters:
name
- the module nameversion
- the module version. Caller should specify a correct version.resolve
- should the module be resolved or not- Returns:
- the module instance or null if none can be found
- Throws:
ResolveError
- if the module dependencies cannot be resolved
-
parseInhabitants
protected java.util.List<ActiveDescriptor> parseInhabitants(Module module, java.lang.String name, ServiceLocator serviceLocator, java.util.List<PopulatorPostProcessor> postProcessors) throws java.io.IOException
- Overrides:
parseInhabitants
in classModulesRegistryImpl
- Throws:
java.io.IOException
-
-