Package org.jvnet.hk2.osgiadapter
Class AbstractOSGiModulesRegistryImpl
java.lang.Object
com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
org.jvnet.hk2.osgiadapter.AbstractOSGiModulesRegistryImpl
- All Implemented Interfaces:
ModuleChangeListener,ModulesRegistry
- Direct Known Subclasses:
OSGiModulesRegistryImpl,OSGiObrModulesRegistryImpl
- Author:
- sanjeeb.sahoo@oracle.com
-
Field Summary
FieldsFields inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
modules, parent, providers, repositories -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractOSGiModulesRegistryImpl(org.osgi.framework.BundleContext bctx) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModuleChangeListener(ModuleChangeListener listener, OSGiModuleImpl module) voidgetModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> defs) Returns a ClassLoader capable of loading classes from a set of modules identified by their module definitiongetModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> mds, URL[] urls) Returns a ClassLoader capable of loading classes from a set of modules identified by their module definition and also load new urls.org.osgi.service.packageadmin.PackageAdminReturns the parent class loader parenting the class loaders created by modules associated with this registry.List<org.glassfish.hk2.api.ActiveDescriptor>parseInhabitants(HK2Module module, String name, org.glassfish.hk2.api.ServiceLocator serviceLocator, List<org.glassfish.hk2.api.PopulatorPostProcessor> postProcessors) voidregister(ModuleLifecycleListener listener) voidbooleanvoidsetParentClassLoader(ClassLoader parent) Sets the classloader parenting the class loaders created by the modules associated with this registry.voidshutdown()voidunregister(ModuleLifecycleListener listener) Methods inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
add, add, add, addRepository, addRepository, changed, createServiceLocator, createServiceLocator, createServiceLocator, dumpState, getAllServiceLocators, getModules, getModules, getModulesProvider, getProvidersClass, getProvidingModule, getRepository, getRunningServices, initializeServiceLocator, loadFromRepository, makeModuleFor, makeModuleFor, makeModuleFor, newModule, newServiceLocator, newServiceLocator, populateConfig, populateServiceLocator, print, registerRunningService, removeRepository, unregisterRunningService
-
Field Details
-
pa
protected org.osgi.service.packageadmin.PackageAdmin pa
-
-
Constructor Details
-
AbstractOSGiModulesRegistryImpl
protected AbstractOSGiModulesRegistryImpl(org.osgi.framework.BundleContext bctx)
-
-
Method Details
-
shutdown
public void shutdown() -
parseInhabitants
public List<org.glassfish.hk2.api.ActiveDescriptor> parseInhabitants(HK2Module module, String name, org.glassfish.hk2.api.ServiceLocator serviceLocator, List<org.glassfish.hk2.api.PopulatorPostProcessor> postProcessors) throws IOException, BootException - Specified by:
parseInhabitantsin classAbstractModulesRegistryImpl- Throws:
IOExceptionBootException
-
createChild
-
detachAll
public void detachAll() -
setParentClassLoader
Sets the classloader parenting the class loaders created by the modules associated with this registry.- Parameters:
parent- parent class loader
-
getParentClassLoader
Returns the parent class loader parenting the class loaders created by modules associated with this registry.- Returns:
- the parent classloader
-
getModulesClassLoader
public ClassLoader getModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> mds, URL[] urls) throws ResolveError Returns a ClassLoader capable of loading classes from a set of modules identified by their module definition and also load new urls.- Parameters:
parent- the parent class loader for the returned class loader instancemds- module definitions for all modules this classloader should be capable of loadingurls- urls to be added to the module classloader- Returns:
- class loader instance
- Throws:
ResolveError- if one of the provided module definition cannot be resolved
-
getModulesClassLoader
public ClassLoader getModulesClassLoader(ClassLoader parent, Collection<ModuleDefinition> defs) throws ResolveError Returns a ClassLoader capable of loading classes from a set of modules identified by their module definition- Parameters:
parent- the parent class loader for the returned class loader instancedefs- module definitions for all modules this classloader should be capable of loading classes from- Returns:
- class loader instance
- Throws:
ResolveError- if one of the provided module definition cannot be resolved
-
find
-
getPackageAdmin
public org.osgi.service.packageadmin.PackageAdmin getPackageAdmin() -
addModuleChangeListener
-
removeModuleChangeListener
-
register
-
unregister
-
remove
- Overrides:
removein classAbstractModulesRegistryImpl
-