org.silvermoon.moonglow.plugin
Class BasePlugin

java.lang.Object
  |
  +--org.silvermoon.moonglow.plugin.BasePlugin
All Implemented Interfaces:
Plugin
Direct Known Subclasses:
BasicPlugin, TestPlugin

public abstract class BasePlugin
extends java.lang.Object
implements Plugin

Provides basic services for all Plugin classes, including ResponseListener registration and several fireEvent() methods


Constructor Summary
BasePlugin(java.lang.String pluginId)
           
 
Method Summary
 void addResponseListener(ResponseListener l)
          Register a listener for the Response
abstract  void doRequest(int requestId, Request request)
          Perform a request, specifying a unique requestId
protected  void fireResponse(int requestId, Response response)
          Plugins should call this method to return the Response to the caller
protected  void fireResponseError(int requestId, java.lang.Throwable error)
          Plugins should call this method to return an error to the caller
 java.lang.String getId()
          Get a unique identifier for this plugin
 void removeResponseListener(ResponseListener l)
          Deregister a ResponseListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePlugin

public BasePlugin(java.lang.String pluginId)
Method Detail

doRequest

public abstract void doRequest(int requestId,
                               Request request)
                        throws PluginException
Description copied from interface: Plugin
Perform a request, specifying a unique requestId

Specified by:
doRequest in interface Plugin
PluginException

getId

public java.lang.String getId()
Description copied from interface: Plugin
Get a unique identifier for this plugin

Specified by:
getId in interface Plugin

addResponseListener

public void addResponseListener(ResponseListener l)
Description copied from interface: Plugin
Register a listener for the Response

Specified by:
addResponseListener in interface Plugin

removeResponseListener

public void removeResponseListener(ResponseListener l)
Description copied from interface: Plugin
Deregister a ResponseListener

Specified by:
removeResponseListener in interface Plugin

fireResponse

protected void fireResponse(int requestId,
                            Response response)
Plugins should call this method to return the Response to the caller


fireResponseError

protected void fireResponseError(int requestId,
                                 java.lang.Throwable error)
Plugins should call this method to return an error to the caller