org.rhq.core.pluginapi.plugin
Interface PluginLifecycleListener


public interface PluginLifecycleListener

Performs global initialization and shutdown of a plugin. This class will be notified when the plugin is loaded and unloaded. This provides a place for plugin developers to allocate global resources needed by all plugin components and a place to clean up those resources.


Method Summary
 void initialize(PluginContext context)
          When a plugin is being loaded, this method will be called.
 void shutdown()
          When the plugin container shuts down and it unloads the plugin, this method will be called.
 

Method Detail

initialize

void initialize(PluginContext context)
                throws Exception
When a plugin is being loaded, this method will be called. When this is called, no plugin resource or discovery components have been instantiated or invoked yet. This is merely called to notify the plugin that it is about to be placed into service and its components will soon be asked to discovery and manage resources.

Parameters:
context - a context with information about the runtime plugin environment
Throws:
Exception - if the plugin finds that it should not be loaded, an exception should be thrown. If thrown, this plugin will not be loaded and will be considered disabled. If other plugins are dependent on this failed plugin, those other plugins will fail to operate correctly.

shutdown

void shutdown()
When the plugin container shuts down and it unloads the plugin, this method will be called. This provides an opportunity for the plugin to clean up any global resources it has previously allocated. After this method is called, invocations of this plugin's discovery or resource components will no longer occur.



Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.