com.ibm.wbi.plugin
Class Plugin

java.lang.Object
  |
  +--com.ibm.wbi.plugin.Plugin
Direct Known Subclasses:
HttpPlugin

public abstract class Plugin
extends java.lang.Object

A plugin is a component that can be added to the proxy to do content tailoring. The plugin is used as a wrapper around a set of megs that all do related tailoring. There are four state methods of a plugin signaled by these four method calls: initialize(String) enable() disable() terminate(String). Megs should be added to the plugin by using the addMeg(Meg) method call usually in the initialize() call.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information.
 
Constructor Summary
Plugin()
          Constructs a new empty plugin.
 
Method Summary
 void addMeg(Meg meg)
          Add a meg to the plugin.
 void addMeg(Monitor monitor, Editor editor)
          Add a monitor to the plugin that will be run after the specified editor.
 void disable()
          Called when the plugin is disabled after being enabled.
 void enable()
          Called when the plugin is enabled after being disabled.
 java.util.Enumeration enumerateMegs()
          Get all the megs added to this plugin.
 PluginDescriptor getDescriptor()
          Get the plugin desciptor.
 java.lang.String getInstallName()
          Get the install name which is just the fully-qualified class name of the plugin.
 com.ibm.wbi.plugin.FunctionalSupportLibrary getLibrary()
          Get the functional support library that is used as a common functionality repository for plugins and megs.
 com.ibm.wbi.plugin.PluginManager getPluginManager()
          Get the plugin manager of this plugin.
 Proxy getProxy()
          Get the proxy of this plugin.
 java.lang.String getSetupUrl()
          Get the setup URL for this plugin.
abstract  void initialize(java.lang.String initData)
          Called when the plugin is initialized.
 void setDescriptor(PluginDescriptor descriptor)
          Set the plugin descriptor.
 void setSetupUrl(java.lang.String setupUrl)
          Set the setup URL for this plugin.
 void terminate(java.lang.String initData)
          Called when plugin is terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information.
Constructor Detail

Plugin

public Plugin()
Constructs a new empty plugin.
Method Detail

initialize

public abstract void initialize(java.lang.String initData)
                         throws com.ibm.wbi.plugin.PluginException
Called when the plugin is initialized.
Parameters:
initData - Initialization data.
Throws:
com.ibm.wbi.plugin.PluginException - Thrown if an error occurs.

enable

public void enable()
            throws com.ibm.wbi.plugin.PluginException
Called when the plugin is enabled after being disabled.
Throws:
com.ibm.wbi.plugin.PluginException - Thrown if an error occurs.

disable

public void disable()
             throws com.ibm.wbi.plugin.PluginException
Called when the plugin is disabled after being enabled.
Throws:
com.ibm.wbi.plugin.PluginException - Thrown if an error occurs.

terminate

public void terminate(java.lang.String initData)
               throws com.ibm.wbi.plugin.PluginException
Called when plugin is terminated.
Parameters:
initData - Termination initialization data.
Throws:
com.ibm.wbi.plugin.PluginException - Thrown if an error occurs.

getInstallName

public java.lang.String getInstallName()
Get the install name which is just the fully-qualified class name of the plugin.
Returns:
The plugin install name.

enumerateMegs

public final java.util.Enumeration enumerateMegs()
Get all the megs added to this plugin.
Returns:
An enumeration of the added megs.

addMeg

public final void addMeg(Meg meg)
                  throws com.ibm.wbi.plugin.PluginError
Add a meg to the plugin. This is usually done in the initialize(String) method.
Parameters:
meg - The meg to add.
Throws:
com.ibm.wbi.plugin.PluginError - If any error occurs.

addMeg

public final void addMeg(Monitor monitor,
                         Editor editor)
                  throws com.ibm.wbi.plugin.PluginError
Add a monitor to the plugin that will be run after the specified editor.
Parameters:
monitor - The monitor to add.
editor - The editor to run monitor after.
Throws:
com.ibm.wbi.plugin.PluginError - If any error occurs.

setDescriptor

public void setDescriptor(PluginDescriptor descriptor)
Set the plugin descriptor.
Parameters:
descriptor - The plugin descriptor.

getDescriptor

public PluginDescriptor getDescriptor()
Get the plugin desciptor.
Returns:
The plugin descriptor that describes this plugin

getLibrary

public final com.ibm.wbi.plugin.FunctionalSupportLibrary getLibrary()
Get the functional support library that is used as a common functionality repository for plugins and megs.
Returns:
The library, or null if the plugin is not registered under a plugin manager or the library does not exist due to an internal error.

getPluginManager

public final com.ibm.wbi.plugin.PluginManager getPluginManager()
Get the plugin manager of this plugin.
Returns:
null if not registered; else the plugin manager the plugin is registered under.

getProxy

public final Proxy getProxy()
Get the proxy of this plugin.
Returns:
null if not registered; else the proxy the plugin is registered under.

getSetupUrl

public final java.lang.String getSetupUrl()
Get the setup URL for this plugin.
Returns:
the URL for configuring this plugin

setSetupUrl

public final void setSetupUrl(java.lang.String setupUrl)
Set the setup URL for this plugin.
Parameters:
setupUrl - the URL for configuring this plugin