com.sun.enterprise.module.single
Class SingleModulesRegistry

java.lang.Object
  extended by com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
      extended by com.sun.enterprise.module.impl.ModulesRegistryImpl
          extended by com.sun.enterprise.module.single.SingleModulesRegistry
All Implemented Interfaces:
ModuleChangeListener, ModulesRegistry, InhabitantsParserFactory
Direct Known Subclasses:
StaticModulesRegistry

public class SingleModulesRegistry
extends ModulesRegistryImpl

Normal modules registry with configuration handling backed up by a single class loader. There is one virtual module available in the modules registry and that module's class loader is the single class loader used to load all artifacts.

Author:
Jerome Dochez

Field Summary
 
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
modules, parent, providers, repositories
 
Constructor Summary
SingleModulesRegistry(ClassLoader singleCL)
           
SingleModulesRegistry(ClassLoader singleCL, List<ManifestProxy.SeparatorMappings> mappings)
           
 
Method Summary
 Module find(Class clazz)
          Finds the Module that owns the given class.
 Collection<Module> getModules()
          Returns the list of shared Modules registered in this instance.
 Collection<Module> getModules(String moduleName)
          Returns the list of shared Modules registered in this instance whose name matches the given name
 Module makeModuleFor(String name, String version, boolean resolve)
          Returns the Module instance giving a name and version constraints.
protected  void parseInhabitants(Module module, String name, ServiceLocator serviceLocator)
           
 
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, createInhabitantsParser, createServiceLocator, dumpState, getModulesProvider, getProvidersClass, getRepository, getRunningServices, initializeServiceLocator, loadFromRepository, makeModuleFor, makeModuleFor, newServiceLocator, newServiceLocator, populateConfig, populateServiceLocator, print, registerRunningService, remove, removeRepository, unregisterRunningService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleModulesRegistry

public SingleModulesRegistry(ClassLoader singleCL)

SingleModulesRegistry

public SingleModulesRegistry(ClassLoader singleCL,
                             List<ManifestProxy.SeparatorMappings> mappings)
Method Detail

find

public Module find(Class clazz)
Description copied from interface: ModulesRegistry
Finds the Module that owns the given class.

Specified by:
find in interface ModulesRegistry
Overrides:
find in class ModulesRegistryImpl
Returns:
null if the class is loaded outside the module system.

getModules

public Collection<Module> getModules(String moduleName)
Description copied from interface: ModulesRegistry
Returns the list of shared Modules registered in this instance whose name matches the given name

The returned list will not include the modules defined in the ancestor ModulesRegistrys.

Specified by:
getModules in interface ModulesRegistry
Overrides:
getModules in class AbstractModulesRegistryImpl
Returns:
an umodifiable list of loaded modules having names that match the given name

getModules

public 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 AbstractModulesRegistryImpls.

Specified by:
getModules in interface ModulesRegistry
Overrides:
getModules in class AbstractModulesRegistryImpl
Returns:
an umodifiable list of loaded modules

makeModuleFor

public Module makeModuleFor(String name,
                            String version,
                            boolean resolve)
                     throws ResolveError
Description copied from interface: ModulesRegistry
Returns the Module instance giving a name and version constraints.

Specified by:
makeModuleFor in interface ModulesRegistry
Overrides:
makeModuleFor in class AbstractModulesRegistryImpl
Parameters:
name - the module name
version - 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 void parseInhabitants(Module module,
                                String name,
                                ServiceLocator serviceLocator)
                         throws IOException
Overrides:
parseInhabitants in class ModulesRegistryImpl
Throws:
IOException


Copyright © 2013 Oracle Corporation. All Rights Reserved.