|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl
org.jvnet.hk2.osgiadapter.OSGiModulesRegistryImpl
public class OSGiModulesRegistryImpl
This is an implementation of ModulesRegistry.
It uses OSGi extender pattern to do necessary parsing of OSGi bundles.
| Field Summary |
|---|
| Fields inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl |
|---|
modules, parent, providers, repositories |
| Method Summary | |
|---|---|
protected void |
add(Module newModule)
|
void |
addModuleChangeListener(ModuleChangeListener listener,
OSGiModuleImpl module)
|
void |
bundleChanged(org.osgi.framework.BundleEvent event)
|
ModulesRegistry |
createChild()
|
void |
detachAll()
|
Module |
find(Class clazz)
|
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> 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.PackageAdmin |
getPackageAdmin()
|
ClassLoader |
getParentClassLoader()
Returns the parent class loader parenting the class loaders created by modules associated with this registry. |
protected Module |
newModule(ModuleDefinition moduleDef)
|
void |
parseInhabitants(Module module,
String name,
InhabitantsParser inhabitantsParser)
|
void |
register(ModuleLifecycleListener listener)
|
void |
remove(Module module)
|
boolean |
removeModuleChangeListener(ModuleChangeListener listener)
|
void |
setParentClassLoader(ClassLoader parent)
Sets the classloader parenting the class loaders created by the modules associated with this registry. |
void |
shutdown()
|
void |
unregister(ModuleLifecycleListener listener)
|
| Methods inherited from class com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl |
|---|
add, add, addRepository, addRepository, changed, createHabitat, createHabitat, createHabitat, createInhabitantsParser, dumpState, getModules, getModules, getModulesProvider, getProvidersClass, getProvidingModule, getRepository, getRunningServices, initializeHabitat, loadFromRepository, makeModuleFor, makeModuleFor, makeModuleFor, newHabitat, newHabitat, populateConfig, print, registerRunningService, removeRepository, unregisterRunningService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerprotected void add(Module newModule)
add in class AbstractModulesRegistryImplpublic void remove(Module module)
remove in class AbstractModulesRegistryImplprotected Module newModule(ModuleDefinition moduleDef)
newModule in class AbstractModulesRegistryImpl
public void parseInhabitants(Module module,
String name,
InhabitantsParser inhabitantsParser)
throws IOException
parseInhabitants in class AbstractModulesRegistryImplIOExceptionpublic ModulesRegistry createChild()
createChild in interface ModulesRegistrypublic void detachAll()
detachAll in interface ModulesRegistrypublic void shutdown()
shutdown in interface ModulesRegistrypublic void setParentClassLoader(ClassLoader parent)
setParentClassLoader in interface ModulesRegistryparent - parent class loaderpublic ClassLoader getParentClassLoader()
getParentClassLoader in interface ModulesRegistry
public ClassLoader getModulesClassLoader(ClassLoader parent,
Collection<ModuleDefinition> mds,
URL[] urls)
throws ResolveError
getModulesClassLoader in interface ModulesRegistryparent - 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
ResolveError - if one of the provided module
definition cannot be resolved
public ClassLoader getModulesClassLoader(ClassLoader parent,
Collection<ModuleDefinition> defs)
throws ResolveError
getModulesClassLoader in interface ModulesRegistryparent - the parent class loader for the returned class loader instancedefs - module definitions for all modules this classloader should be
capable of loading classes from
ResolveError - if one of the provided module
definition cannot be resolvedpublic Module find(Class clazz)
find in interface ModulesRegistrypublic org.osgi.service.packageadmin.PackageAdmin getPackageAdmin()
public void addModuleChangeListener(ModuleChangeListener listener,
OSGiModuleImpl module)
public boolean removeModuleChangeListener(ModuleChangeListener listener)
public void register(ModuleLifecycleListener listener)
register in interface ModulesRegistrypublic void unregister(ModuleLifecycleListener listener)
unregister in interface ModulesRegistry
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||