org.rhq.enterprise.server.plugin.pc.perspective
Class PerspectiveServerPluginManager

java.lang.Object
  extended by org.rhq.enterprise.server.plugin.pc.ServerPluginManager
      extended by org.rhq.enterprise.server.plugin.pc.perspective.PerspectiveServerPluginManager

public class PerspectiveServerPluginManager
extends ServerPluginManager

This loads in all perspective server plugins that can be found. You can obtain a loaded plugin's environment, including its classloader, from this object as well.

Author:
Jay Shaughnessy, John Mazzitelli

Constructor Summary
PerspectiveServerPluginManager(PerspectiveServerPluginContainer pc)
           
 
Method Summary
 PerspectivePluginMetadataManager getMetadataManager()
          An object that can be used to process and store all metadata from all perspective plugins.
 void initialize()
          Initializes the plugin manager to prepare it to start loading plugins.
 void loadPlugin(ServerPluginEnvironment env, boolean enabled)
          Informs the plugin manager that a plugin with the given environment needs to be loaded.
 void shutdown()
          Shuts down this manager.
protected  void startPlugin(String pluginName)
           
 void startPlugins()
          All of the plugins have been loaded, so now let the metadata manager sort through the definitions.
protected  void stopPlugin(String pluginName)
           
 void stopPlugins()
           
 void unloadPlugin(String pluginName)
          Informs the plugin manager that a plugin with the given name is to be unloaded.
 
Methods inherited from class org.rhq.enterprise.server.plugin.pc.ServerPluginManager
createServerPluginComponent, disablePlugin, enablePlugin, getLog, getParentPluginContainer, getPlugin, getPluginEnvironment, getPluginEnvironments, getServerPluginComponent, getServerPluginContext, instantiatePluginClass, isPluginEnabled, isPluginLoaded, loadPluginClass, rebuildServerPluginEnvironment, reloadPlugin, unloadPlugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerspectiveServerPluginManager

public PerspectiveServerPluginManager(PerspectiveServerPluginContainer pc)
Method Detail

initialize

public void initialize()
                throws Exception
Description copied from class: ServerPluginManager
Initializes the plugin manager to prepare it to start loading plugins.

Overrides:
initialize in class ServerPluginManager
Throws:
Exception - if failed to initialize

shutdown

public void shutdown()
Description copied from class: ServerPluginManager
Shuts down this manager. This should be called only after all of its plugins have been unloaded.

Overrides:
shutdown in class ServerPluginManager

getMetadataManager

public PerspectivePluginMetadataManager getMetadataManager()
An object that can be used to process and store all metadata from all perspective plugins. This object will contain all the metadata found in all loaded perspective plugins.

Returns:
object to retrieve plugin metadata from

loadPlugin

public void loadPlugin(ServerPluginEnvironment env,
                       boolean enabled)
                throws Exception
Description copied from class: ServerPluginManager
Informs the plugin manager that a plugin with the given environment needs to be loaded. Once this method returns, the plugin's components are ready to be created and used, unless enabled is false, in which case the plugin will not be initialized.

Overrides:
loadPlugin in class ServerPluginManager
Parameters:
env - the environment of the plugin to be loaded
enabled - true if the plugin should be initialized; false if the plugin's existence should be noted but it should not be initialized or started
Throws:
Exception - if the plugin manager cannot load the plugin or deems the plugin invalid. Typically, this method will not throw an exception unless enabled is true - loading a disabled plugin is trivial and should not fail or throw an exception.

startPlugin

protected void startPlugin(String pluginName)
Overrides:
startPlugin in class ServerPluginManager

startPlugins

public void startPlugins()
All of the plugins have been loaded, so now let the metadata manager sort through the definitions.

Overrides:
startPlugins in class ServerPluginManager
See Also:
ServerPluginManager.startPlugins()

stopPlugin

protected void stopPlugin(String pluginName)
Overrides:
stopPlugin in class ServerPluginManager

stopPlugins

public void stopPlugins()
Overrides:
stopPlugins in class ServerPluginManager

unloadPlugin

public void unloadPlugin(String pluginName)
                  throws Exception
Description copied from class: ServerPluginManager
Informs the plugin manager that a plugin with the given name is to be unloaded. The component's shutdown method will be called.

Overrides:
unloadPlugin in class ServerPluginManager
Parameters:
pluginName - the name of the plugin to be unloaded
Throws:
Exception - if the plugin manager cannot unload the plugin


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.