com.aelitis.azureus.core.messenger.browser
Interface BrowserMessageDispatcher

All Known Implementing Classes:
MessageDispatcherSWT

public interface BrowserMessageDispatcher

Author:
TuxPaper

Method Summary
 void addListener(BrowserMessageListener listener)
          Registers the given listener for the given ID.
 void dispatch(BrowserMessage message)
          Dispatches the given message to the appropriate listener.
 BrowserMessageListener getListener(String id)
          Returns the listener with the given ID.
 void removeListener(BrowserMessageListener listener)
          Deregisters the listener with the given ID.
 void removeListener(String id)
          Deregisters the listener with the given ID.
 

Method Detail

addListener

void addListener(BrowserMessageListener listener)
Registers the given listener for the given ID.

Parameters:
id - unique identifier used when dispatching messages
listener - receives messages targetted at the given ID
Throws:
IllegalStateException - if another listener is already registered under the same ID

dispatch

void dispatch(BrowserMessage message)
Dispatches the given message to the appropriate listener.

Parameters:
message - holds the listener ID, operation ID and parameters
Throws:
IllegalArgumentException - if no listener is registered with the given ID

getListener

BrowserMessageListener getListener(String id)
Returns the listener with the given ID.

Parameters:
id - unique identifier of the listener to be returned
Returns:
the located listener

removeListener

void removeListener(BrowserMessageListener listener)
Deregisters the listener with the given ID.

Parameters:
id - unique identifier of the listener to be removed

removeListener

void removeListener(String id)
Deregisters the listener with the given ID.

Parameters:
id - unique identifier of the listener to be removed