public class ClassLoaderManager extends Object
| Constructor and Description |
|---|
ClassLoaderManager(Map<URL,? extends ServerPluginDescriptorType> plugins,
ClassLoader rootClassLoader,
File tmpDir)
Creates the object that will manage all classloaders for the plugins deployed in the server.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfServerPluginClassLoaders()
Returns the total number of plugin classloaders that have been created and managed.
|
ClassLoader |
getRootClassLoader()
Returns the classloader that should be the ancestor (i.e.
|
Map<org.rhq.core.domain.plugin.PluginKey,ClassLoader> |
getServerPluginClassLoaders()
Returns a shallow copy of the plugin classloaders keyed on plugin key.
|
void |
loadPlugin(URL pluginUrl,
ServerPluginDescriptorType descriptor)
Hot-deploys a plugin into this classloader manager.
|
ClassLoader |
obtainServerPluginClassLoader(org.rhq.core.domain.plugin.PluginKey pluginKey)
Returns a plugin classloader (creating it if necessary).
|
void |
shutdown()
Cleans up this object and all classloaders it has created.
|
String |
toString() |
void |
unloadPlugin(org.rhq.core.domain.plugin.PluginKey pluginKey)
Unloads the plugin identified with the current key from this classloader manager and destroys
that plugin's classloader, if one existed.
|
public ClassLoaderManager(Map<URL,? extends ServerPluginDescriptorType> plugins, ClassLoader rootClassLoader, File tmpDir)
plugins - maps a plugin URL to that plugin's descriptorrootClassLoader - the classloader at the top of the classloader hierarchytmpDir - where the classloaders can write out the jars that are embedded in the plugin jarspublic void shutdown()
public void loadPlugin(URL pluginUrl, ServerPluginDescriptorType descriptor)
pluginUrl - location of the plugin jar filedescriptor - the plugin descriptorpublic void unloadPlugin(org.rhq.core.domain.plugin.PluginKey pluginKey)
pluginKey - identifies the plugin to be unloadedpublic ClassLoader getRootClassLoader()
public ClassLoader obtainServerPluginClassLoader(org.rhq.core.domain.plugin.PluginKey pluginKey) throws Exception
pluginKey - the plugin whose classloader is to be createdExceptionpublic int getNumberOfServerPluginClassLoaders()
public Map<org.rhq.core.domain.plugin.PluginKey,ClassLoader> getServerPluginClassLoaders()
#obtainServerPluginClassLoader(String).null)Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.