org.rhq.core.pc.plugin
Class PluginManager

java.lang.Object
  extended by org.rhq.core.pc.plugin.PluginManager
All Implemented Interfaces:
ContainerService

public class PluginManager
extends Object
implements ContainerService

This container service will load in all plugins that can be found and will maintain the complete set of metadata found in all plugin descriptors from all loaded plugins. You can obtain a loaded plugin's environment, including its classloader, from this object as well - see getPlugin(String).

Author:
Greg Hinkle, Jason Dobies, John Mazzitelli

Constructor Summary
PluginManager()
           
 
Method Summary
 String getAmpsVersion(String pluginName)
           
 ClassLoaderManager getClassLoaderManager()
          Returns the manager of all classloaders created for the plugin manager.
 PluginMetadataManager getMetadataManager()
          An object that can be used to process and store all metadata from all plugins.
 PluginEnvironment getPlugin(String name)
          Returns the PluginEnvironment for the specific plugin with the given name.
 Collection<PluginEnvironment> getPlugins()
          Returns the PluginEnvironments for every plugin this manager found and loaded.
 void initialize()
          Finds all plugins using the plugin finder defined in the plugin container configuration and loads each plugin found.
 void setConfiguration(PluginContainerConfiguration configuration)
          Informs the container service how it should be configured by providing the full plugin container configuration.
 void setPluginLifecycleListenerManager(PluginLifecycleListenerManager pluginLifecycleListenerManager)
           
 void shutdown()
          Stops the container service which effectively releases all runtime resources such as running threads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginManager

public PluginManager()
Method Detail

initialize

public void initialize()
Finds all plugins using the plugin finder defined in the plugin container configuration and loads each plugin found.

Specified by:
initialize in interface ContainerService
See Also:
ContainerService.initialize()

shutdown

public void shutdown()
Description copied from interface: ContainerService
Stops the container service which effectively releases all runtime resources such as running threads.

Specified by:
shutdown in interface ContainerService
See Also:
ContainerService.shutdown()

setConfiguration

public void setConfiguration(PluginContainerConfiguration configuration)
Description copied from interface: ContainerService
Informs the container service how it should be configured by providing the full plugin container configuration. The plugin container will ensure it passes in a non-null configuration object so implementations of this interface should never have to worry about a null configuration parameter value.

Specified by:
setConfiguration in interface ContainerService
See Also:
ContainerService.setConfiguration(PluginContainerConfiguration)

setPluginLifecycleListenerManager

public void setPluginLifecycleListenerManager(PluginLifecycleListenerManager pluginLifecycleListenerManager)

getPlugins

public Collection<PluginEnvironment> getPlugins()
Returns the PluginEnvironments for every plugin this manager found and loaded.

Returns:
environments for all the plugins

getPlugin

@Nullable
public PluginEnvironment getPlugin(String name)
Returns the PluginEnvironment for the specific plugin with the given name.

The plugin's name is defined in its plugin descriptor - specifically the XML root node's "name" attribute (e.g. <plugin name="thePluginName").

Parameters:
name - plugin name as defined in the plugin's descriptor
Returns:
the environment of the loaded plugin with the given name (null if there is no loaded plugin with the given name)

getMetadataManager

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

Returns:
object to retrieve plugin metadata from

getClassLoaderManager

public ClassLoaderManager getClassLoaderManager()
Returns the manager of all classloaders created for the plugin manager.

Returns:
the classloader manager for all plugins

getAmpsVersion

public String getAmpsVersion(String pluginName)


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