public class ModulesRegistryImpl extends AbstractModulesRegistryImpl
modules, parent, providers, repositories
Constructor and Description |
---|
ModulesRegistryImpl(ModulesRegistry parent) |
Modifier and Type | Method and Description |
---|---|
ModulesRegistry |
createChild()
Creates a new child
ModulesRegistryImpl in this ModulesRegistryImpl . |
void |
detachAll()
Detaches all the modules from this registry.
|
Module |
find(Class clazz)
Finds the
Module that owns the given class. |
List<ModuleLifecycleListener> |
getLifecycleListeners() |
ClassLoader |
getModulesClassLoader(ClassLoader parent,
Collection<ModuleDefinition> defs)
Returns a ClassLoader capable of loading classes from a set of modules identified
by their module definition
|
ClassLoader |
getModulesClassLoader(ClassLoader parent,
Collection<ModuleDefinition> defs,
URL[] urls)
Returns a ClassLoader capable of loading classes from a set of modules identified
by their module definition and also load new urls.
|
ClassLoader |
getParentClassLoader()
Returns the parent class loader parenting the class loaders created
by modules associated with this registry.
|
ModuleImpl |
getProvidingModule(String providerClassName)
Gets the
Module that provides the provider of the given name. |
protected Module |
newModule(ModuleDefinition moduleDef)
Factory method for creating new instances of Module.
|
protected List<ActiveDescriptor> |
parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
void |
register(ModuleLifecycleListener listener)
Add a
ModuleLifecycleListener to this registry. |
void |
setParentClassLoader(ClassLoader parent)
Sets the classloader parenting the class loaders created by the modules
associated with this registry.
|
void |
shutdown()
Shuts down this module's registry, apply housekeeping tasks
|
void |
unregister(ModuleLifecycleListener listener)
Removes an
ModuleLifecycleListener from this registry. |
add, add, add, addRepository, addRepository, changed, createServiceLocator, createServiceLocator, createServiceLocator, dumpState, getAllServiceLocators, getModules, getModules, getModulesProvider, getProvidersClass, getRepository, getRunningServices, initializeServiceLocator, loadFromRepository, makeModuleFor, makeModuleFor, makeModuleFor, newServiceLocator, newServiceLocator, populateConfig, populateServiceLocator, print, registerRunningService, remove, removeRepository, unregisterRunningService
public ModulesRegistryImpl(ModulesRegistry parent)
public ModulesRegistry createChild()
ModulesRegistryImpl
in this ModulesRegistryImpl
.protected Module newModule(ModuleDefinition moduleDef)
AbstractModulesRegistryImpl
newModule
in class AbstractModulesRegistryImpl
moduleDef
- module definition of the new module to be createdprotected List<ActiveDescriptor> parseInhabitants(Module module, String name, ServiceLocator serviceLocator, List<PopulatorPostProcessor> postProcessors) throws IOException
parseInhabitants
in class AbstractModulesRegistryImpl
IOException
public ModuleImpl getProvidingModule(String providerClassName)
ModulesRegistry
Module
that provides the provider of the given name.getProvidingModule
in interface ModulesRegistry
getProvidingModule
in class AbstractModulesRegistryImpl
public void setParentClassLoader(ClassLoader parent)
parent
- parent class loaderpublic ClassLoader getParentClassLoader()
public ClassLoader getModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> defs, URL[] urls) throws ResolveError
parent
- the parent class loader for the returned class loader instancedefs
- module definitions for all modules this classloader should be
capable of loadingurls
- urls to be added to the module classloaderResolveError
- if one of the provided module
definition cannot be resolvedpublic ClassLoader getModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> defs) throws ResolveError
parent
- the parent class loader for the returned class loader instancedefs
- module definitions for all modules this classloader should be
capable of loading classes fromResolveError
- if one of the provided module
definition cannot be resolvedpublic Module find(Class clazz)
ModulesRegistry
Module
that owns the given class.public void register(ModuleLifecycleListener listener)
ModuleLifecycleListener
to this registry. The listener
will be notified for each module startup and shutdown.listener
- the listener implementationpublic void unregister(ModuleLifecycleListener listener)
ModuleLifecycleListener
from this registry.
Notification of module startup and shutdown will not be emitted to this
listener any longer.listener
- the listener to unregisterpublic List<ModuleLifecycleListener> getLifecycleListeners()
public void detachAll()
public void shutdown()
Copyright © 2009–2023 Oracle Corporation. All rights reserved.