org.rhq.core.pc.plugin
Interface PluginLifecycleListenerManager

All Known Implementing Classes:
PluginLifecycleListenerManagerImpl

public interface PluginLifecycleListenerManager

A manager API that provides operations for loading and instantiating PluginLifecycleListener classes and caching of those objects. This API is is used by PluginManager as it the plugin container service that is responsible loading plugins and their corresponding classes.


Method Summary
 PluginLifecycleListener getListener(String pluginName)
          Retrieves the cached listener for the specified plugin.
 PluginLifecycleListener loadListener(PluginDescriptor pluginDescriptor, PluginEnvironment pluginEnvironment)
          Loads and instantiates the listener class.
 void setListener(String pluginName, PluginLifecycleListener listener)
          Caches the listener for the specified plugin.
 void shutdown()
          Clears and destroys the cache of listeners
 

Method Detail

loadListener

PluginLifecycleListener loadListener(PluginDescriptor pluginDescriptor,
                                     PluginEnvironment pluginEnvironment)
                                     throws PluginContainerException
Loads and instantiates the listener class.

Parameters:
pluginDescriptor - The parsed plugin descriptor
pluginEnvironment - The plugin environment which is needed to perform the class loading
Returns:
An instance of the listener class or null if there is no listener
Throws:
PluginContainerException - if there is an error instantiating the listener class

getListener

PluginLifecycleListener getListener(String pluginName)
Retrieves the cached listener for the specified plugin.

Parameters:
pluginName - The name of the plugin
Returns:
The cached listener object or null if the plugin has not declared a listener or if the listener has not yet been loaded.

setListener

void setListener(String pluginName,
                 PluginLifecycleListener listener)
Caches the listener for the specified plugin. Listeners should be cached only after having been successfully initialized.

Parameters:
pluginName - The name of the plugin
listener - The initialized plugin lifecycle listener

shutdown

void shutdown()
Clears and destroys the cache of listeners



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