Interface BrowserMessageDispatcher

All Known Implementing Classes:
MessageDispatcherSWT

public interface BrowserMessageDispatcher
  • Method Details

    • addListener

      void addListener(BrowserMessageListener listener)
      Registers the given listener for the given ID.
      Parameters:
      listener - receives messages targeted at the given ID
      id - unique identifier used when dispatching messages
      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