Class AbstractBrowserMessageListener

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractBrowserMessageListener​(java.lang.String id)
      Stores the given context for accessing the browser and its services.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void debug​(java.lang.String message)
      Displays a debug message tagged with the listener ID.
      void debug​(java.lang.String message, java.lang.Throwable t)
      Displays a debug message and exception tagged with the listener ID.
      ClientMessageContext getContext()
      Returns the context for this listener.
      java.lang.String 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractBrowserMessageListener

        public AbstractBrowserMessageListener​(java.lang.String id)
        Stores the given context for accessing the browser and its services.
        Parameters:
        context - used to access the browser
    • Method Detail

      • debug

        protected void debug​(java.lang.String message)
        Displays a debug message tagged with the listener ID.
        Parameters:
        message - sent to the debug log
      • debug

        public void debug​(java.lang.String message,
                          java.lang.Throwable t)
        Displays a debug message and exception tagged with the listener ID.
        Parameters:
        message - sent to the debug log
        t - exception to log with message
      • getId

        public java.lang.String getId()
        Returns the unique ID for this listener.
        Specified by:
        getId in interface BrowserMessageListener
        Returns:
        listener's unique ID
      • handleMessage

        public abstract void handleMessage​(BrowserMessage message)
        Handles the given message, usually by parsing the parameters and calling the appropriate operation.
        Specified by:
        handleMessage in interface BrowserMessageListener
        Parameters:
        message - holds all message information
      • setContext

        public void setContext​(ClientMessageContext context)
        Sets the context for this listener. Called by its dispatcher when attached.
        Specified by:
        setContext in interface BrowserMessageListener
        Parameters:
        context - the new context for this listener