FileDocCategorySizeDatePackage
AbstractMessageListener.javaAPI DocAzureus 3.0.3.43132Mon Dec 04 11:59:32 GMT 2006com.aelitis.azureus.ui.swt.browser.msg

AbstractMessageListener

public abstract class AbstractMessageListener extends Object implements MessageListener
Accepts and handles messages dispatched from {@link MessageDispatcher}. Subclasses should use the message's operation ID and parameters to perform the requested operation.
author
dharkness
created
Jul 18, 2006

Fields Summary
protected com.aelitis.azureus.core.messenger.ClientMessageContext
context
private String
id
Constructors Summary
public AbstractMessageListener(String id)
Stores the given context for accessing the browser and its services.

param
context used to access the browser



                            
          
        this.id = id;
    
Methods Summary
protected voiddebug(java.lang.String message)
Displays a debug message tagged with the listener ID.

param
message sent to the debug log

        context.debug("[" + id + "] " + message);
    
public voiddebug(java.lang.String message, java.lang.Throwable t)
Displays a debug message and exception tagged with the listener ID.

param
message sent to the debug log
param
t exception to log with message

        context.debug("[" + id + "] " + message, t);
    
public com.aelitis.azureus.core.messenger.ClientMessageContextgetContext()
Returns the context for this listener.

return
listener's context

        return context;
    
public java.lang.StringgetId()
Returns the unique ID for this listener.

return
listener's unique ID

        return id;
    
public abstract voidhandleMessage(BrowserMessage message)
Handles the given message, usually by parsing the parameters and calling the appropriate operation.

param
message holds all message information

public voidsetContext(com.aelitis.azureus.core.messenger.ClientMessageContext context)
Sets the context for this listener. Called by its dispatcher when attached.

param
context the new context for this listener

        if ( this.context == null ) {
            this.context = context;
        }