Class AbstractBrowserMessageListener
java.lang.Object
com.biglybt.core.messenger.browser.listeners.AbstractBrowserMessageListener
- All Implemented Interfaces:
BrowserMessageListener
- Direct Known Subclasses:
ConfigListener
,DisplayListener
,MetaSearchListener
,TorrentListener
,VuzeListener
public abstract class AbstractBrowserMessageListener
extends Object
implements BrowserMessageListener
Accepts and handles messages dispatched from
BrowserMessageDispatcher
.
Subclasses should use the message's operation ID and parameters to perform
the requested operation.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStores the given context for accessing the browser and its services. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Displays a debug message tagged with the listener ID.void
Displays a debug message and exception tagged with the listener ID.Returns the context for this listener.getId()
Returns the unique ID for this listener.abstract void
handleMessage
(BrowserMessage message) Handles the given message, usually by parsing the parameters and calling the appropriate operation.void
setContext
(ClientMessageContext context) Sets the context for this listener.
-
Field Details
-
context
-
id
-
-
Constructor Details
-
AbstractBrowserMessageListener
Stores the given context for accessing the browser and its services.- Parameters:
context
- used to access the browser
-
-
Method Details
-
debug
Displays a debug message tagged with the listener ID.- Parameters:
message
- sent to the debug log
-
debug
Displays a debug message and exception tagged with the listener ID.- Parameters:
message
- sent to the debug logt
- exception to log with message
-
getContext
Returns the context for this listener.- Specified by:
getContext
in interfaceBrowserMessageListener
- Returns:
- listener's context
-
getId
Returns the unique ID for this listener.- Specified by:
getId
in interfaceBrowserMessageListener
- Returns:
- listener's unique ID
-
handleMessage
Handles the given message, usually by parsing the parameters and calling the appropriate operation.- Specified by:
handleMessage
in interfaceBrowserMessageListener
- Parameters:
message
- holds all message information
-
setContext
Sets the context for this listener. Called by its dispatcher when attached.- Specified by:
setContext
in interfaceBrowserMessageListener
- Parameters:
context
- the new context for this listener
-