|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer
public class MasterServerPluginContainer
The container responsible for managing all the plugin containers for all the different plugin types.
| Constructor Summary | |
|---|---|
MasterServerPluginContainer()
|
|
| Method Summary | ||
|---|---|---|
protected ClassLoaderManager |
createClassLoaderManager(java.util.Map<java.net.URL,? extends ServerPluginDescriptorType> plugins,
java.lang.ClassLoader rootClassLoader,
java.io.File tmpDir)
Creates the manager that will be responsible for instantiating plugin classloaders. |
|
protected java.util.List<AbstractTypeServerPluginContainer> |
createPluginContainers()
Creates the individual plugin containers that can be used to deploy different plugin types. |
|
protected java.lang.ClassLoader |
createRootServerPluginClassLoader()
Create the root classloader that will be the ancester to all plugin classloaders. |
|
ClassLoaderManager |
getClassLoaderManager()
Returns the manager that is responsible for created classloaders for plugins. |
|
MasterServerPluginContainerConfiguration |
getConfiguration()
Returns the configuration that this object was initialized with. |
|
protected java.util.List<PluginKey> |
getDisabledPluginKeys()
This will return a list of plugin keys that represent all the plugins that are to be disabled. |
|
|
getPluginContainerByClass(java.lang.Class<T> clazz)
Get the plugin container of the given class. |
|
protected AbstractTypeServerPluginContainer |
getPluginContainerByDescriptor(ServerPluginDescriptorType descriptor)
Given a plugin's descriptor, this will return the plugin container that can manage the plugin. |
|
|
getPluginContainerByPlugin(PluginKey pluginKey)
Given the key of a deployed plugin, this returns the plugin container that is hosting that plugin. |
|
AbstractTypeServerPluginContainer |
getPluginContainerByPluginType(ServerPluginType pluginType)
Given a server plugin type, this will return the plugin container that can manage that type of plugin. |
|
java.util.List<ServerPluginType> |
getServerPluginTypes()
This will return all known server plugins types. |
|
void |
initialize(MasterServerPluginContainerConfiguration config)
Starts the master plugin container, which will load all plugins and begin managing them. |
|
void |
loadPlugin(java.net.URL pluginUrl,
boolean enabled)
Loads a plugin into the appropriate plugin container. |
|
protected java.util.Map<java.net.URL,? extends ServerPluginDescriptorType> |
preloadAllPlugins()
Finds all plugins and parses their descriptors. |
|
void |
scheduleAllPluginJobs()
Asks that all plugin containers schedule jobs now, if needed. |
|
void |
shutdown()
Stops all plugins and cleans up after them. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MasterServerPluginContainer()
| Method Detail |
|---|
public void initialize(MasterServerPluginContainerConfiguration config)
config - the master configurationpublic void shutdown()
public void loadPlugin(java.net.URL pluginUrl,
boolean enabled)
throws java.lang.Exception
pluginUrl - the location where the new plugin is foundenabled - indicates if the plugin should be enabled as soon as its loaded
java.lang.Exception - if the plugin's descriptor could not be parsed or could not be loaded into the plugin containerpublic void scheduleAllPluginJobs()
initialize(MasterServerPluginContainerConfiguration)
method because it is possible that the master plugin container has been
initialized before the scheduler is started. In this case, the caller must wait for the scheduler to
be started before this method is called to schedule jobs.
public MasterServerPluginContainerConfiguration getConfiguration()
initialized or has been shutdown,
this will return null.
public ClassLoaderManager getClassLoaderManager()
public java.util.List<ServerPluginType> getServerPluginTypes()
getPluginContainerByPluginType(ServerPluginType).
public <T extends AbstractTypeServerPluginContainer> T getPluginContainerByClass(java.lang.Class<T> clazz)
clazz - the class name of the plugin container that the caller wants
null if none found)public <T extends AbstractTypeServerPluginContainer> T getPluginContainerByPlugin(PluginKey pluginKey)
null is returned.
pluginKey -
nullpublic AbstractTypeServerPluginContainer getPluginContainerByPluginType(ServerPluginType pluginType)
null.
pluginType - the type of server plugin whose PC is to be returned
protected AbstractTypeServerPluginContainer getPluginContainerByDescriptor(ServerPluginDescriptorType descriptor)
descriptor - descriptor to identify a plugin whose container is to be returned
protected java.util.Map<java.net.URL,? extends ServerPluginDescriptorType> preloadAllPlugins()
throws java.lang.Exception
initialization.
If a plugin fails to preload, it will be ignored - other plugins will still preload.
java.lang.Exception - on catastrophic failure. Note that if a plugin failed to load,
that plugin will simply be ignored and no exception will be thrownprotected java.util.List<PluginKey> getDisabledPluginKeys()
protected java.util.List<AbstractTypeServerPluginContainer> createPluginContainers()
This is protected to allow subclasses to override the PCs that are created by this service (mainly to support tests).
protected java.lang.ClassLoader createRootServerPluginClassLoader()
protected ClassLoaderManager createClassLoaderManager(java.util.Map<java.net.URL,? extends ServerPluginDescriptorType> plugins,
java.lang.ClassLoader rootClassLoader,
java.io.File tmpDir)
plugins - maps plugin URLs with their parsed descriptorsrootClassLoader - the classloader at the top of the classloader hierarchytmpDir - where the classloaders can write out the jars that are embedded in the plugin jars
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||