Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

plugins.Messenger
Interface MessengerPlugin  view MessengerPlugin download MessengerPlugin.java

All Known Implementing Classes:
AbstractMessengerPlugin

public interface MessengerPlugin

Defines the interface for all Plugins for Messenger. This interface provides methodes for:

Lifecylce Management A plugin is first created by a call to Class.newInstance(). Be aware that every Plugin needs an empty Constructor!. The init method is called to give the plugin a chance to initialze its inner state ie. generate key pairs for encryption plugins, load icons After init called a plugin can be activated and deactivated. There is no constraint that the activate methode is called on and activated of a plugin again. The same is true for deactivated Plugins. If PluginManager considers that a Plugin is not needed any more it calls the Plugins destroy methode. Implement your destroy method to clean up any resources that need some kind of special clean up treatment ie. close Sockets or Streams etc. Sending/Receiving Messages processIncomingMessage is called if the remote sender sends a message to the local client. Is never called if a Plugin is disabled! processOutgoingMessage is called if the user or another plugin wants to send a message to a remote client. Is never called if a Plugin is disabled!


Method Summary
 void addStateListener(plugins.Messenger.event.StateListener listener)
           
 java.lang.Object clone()
          Is called by PluginManager to generate an new Instance of MessengerPlugin for every new PluginChain (PluginChains are constructed for Conversations)
 void destroy()
          Implement Destroy to get rid of any resources that require special destroy behaviour
 javax.swing.ImageIcon getIcon()
          Return the icon of the Plugin.
 java.lang.Character getMnemonic()
           
 java.lang.String getName()
          Return the name of the Plugin.
 MessengerPluginProtocol getProtocol()
          Returns an instance of the used Protocol.
 java.lang.String getToolTip()
           
 void init(Conversation conversation)
          The init method is called after a new Plugin Instance is created.
 boolean isEnabled()
          Is called if the user decides to enable/disable a Plugin for a Conversation.
 plugins.Messenger.event.StateListener removeStateListener(plugins.Messenger.event.StateListener listener)
           
 void setEnabled(boolean enabled, boolean remote)
          Is called if the user decides to enable/disable a Plugin for a Conversation.
 

Method Detail

init

public void init(Conversation conversation)
The init method is called after a new Plugin Instance is created. All code that is needed to create the initial state of the object should go here!


destroy

public void destroy()
Implement Destroy to get rid of any resources that require special destroy behaviour


getName

public java.lang.String getName()
Return the name of the Plugin. The name will be displayed on configuration Panels, Chatframe Menus etc.


getMnemonic

public java.lang.Character getMnemonic()

getToolTip

public java.lang.String getToolTip()

getIcon

public javax.swing.ImageIcon getIcon()
Return the icon of the Plugin. The icon will be displayed on configuration Panels, Chatframe Menus etc.


setEnabled

public void setEnabled(boolean enabled,
                       boolean remote)
Is called if the user decides to enable/disable a Plugin for a Conversation. This Method is called by the MessengerPluginProtocol


isEnabled

public boolean isEnabled()
Is called if the user decides to enable/disable a Plugin for a Conversation. This Method is called by the MessengerPluginProtocol


clone

public java.lang.Object clone()
Is called by PluginManager to generate an new Instance of MessengerPlugin for every new PluginChain (PluginChains are constructed for Conversations)


getProtocol

public MessengerPluginProtocol getProtocol()
Returns an instance of the used Protocol. Be sure to return the same instance on subsequent calls to this method!


addStateListener

public void addStateListener(plugins.Messenger.event.StateListener listener)

removeStateListener

public plugins.Messenger.event.StateListener removeStateListener(plugins.Messenger.event.StateListener listener)