Interface BrowserMessageDispatcher
- All Known Implementing Classes:
MessageDispatcherSWT
public interface BrowserMessageDispatcher
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(BrowserMessageListener listener) Registers the given listener for the given ID.void
dispatch
(BrowserMessage message) Dispatches the given message to the appropriate listener.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 Details
-
addListener
Registers the given listener for the given ID.- Parameters:
id
- unique identifier used when dispatching messageslistener
- receives messages targeted at the given ID- Throws:
IllegalStateException
- if another listener is already registered under the same ID
-
dispatch
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
Returns the listener with the given ID.- Parameters:
id
- unique identifier of the listener to be returned- Returns:
- the located listener
-
removeListener
Deregisters the listener with the given ID.- Parameters:
id
- unique identifier of the listener to be removed
-
removeListener
Deregisters the listener with the given ID.- Parameters:
id
- unique identifier of the listener to be removed
-