org.rhq.core.pc.plugin
Class PluginLifecycleListenerManagerImpl

java.lang.Object
  extended by org.rhq.core.pc.plugin.PluginLifecycleListenerManagerImpl
All Implemented Interfaces:
PluginLifecycleListenerManager

public class PluginLifecycleListenerManagerImpl
extends Object
implements PluginLifecycleListenerManager


Constructor Summary
PluginLifecycleListenerManagerImpl()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginLifecycleListenerManagerImpl

public PluginLifecycleListenerManagerImpl()
Method Detail

loadListener

public PluginLifecycleListener loadListener(PluginDescriptor pluginDescriptor,
                                            PluginEnvironment pluginEnvironment)
                                     throws PluginContainerException
Description copied from interface: PluginLifecycleListenerManager
Loads and instantiates the listener class.

Specified by:
loadListener in interface PluginLifecycleListenerManager
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

public PluginLifecycleListener getListener(String pluginName)
Description copied from interface: PluginLifecycleListenerManager
Retrieves the cached listener for the specified plugin.

Specified by:
getListener in interface PluginLifecycleListenerManager
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

public void setListener(String pluginName,
                        PluginLifecycleListener listener)
Description copied from interface: PluginLifecycleListenerManager
Caches the listener for the specified plugin. Listeners should be cached only after having been successfully initialized.

Specified by:
setListener in interface PluginLifecycleListenerManager
Parameters:
pluginName - The name of the plugin
listener - The initialized plugin lifecycle listener

shutdown

public void shutdown()
Description copied from interface: PluginLifecycleListenerManager
Clears and destroys the cache of listeners

Specified by:
shutdown in interface PluginLifecycleListenerManager


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