Class DebugWindowConnection

java.lang.Object
com.vaadin.base.devserver.DebugWindowConnection
All Implemented Interfaces:
BrowserLiveReload, FragmentedMessageHolder, Serializable

public class DebugWindowConnection extends Object implements BrowserLiveReload
BrowserLiveReload implementation class.

For internal use only. May be renamed or removed in a future release.

Author:
Vaadin Ltd
See Also:
  • Method Details

    • getBackend

      public BrowserLiveReload.Backend getBackend()
      Description copied from interface: BrowserLiveReload
      Detects and return enabling live reload backend technology.
      Specified by:
      getBackend in interface BrowserLiveReload
      Returns:
      enabling technology, or null if none
    • setBackend

      public void setBackend(BrowserLiveReload.Backend backend)
      Description copied from interface: BrowserLiveReload
      Sets the live reload backend technology explicitly.
      Specified by:
      setBackend in interface BrowserLiveReload
      Parameters:
      backend - enabling technology, not null.
    • getDevToolsInterface

      protected DevToolsInterface getDevToolsInterface(org.atmosphere.cpr.AtmosphereResource resource)
    • onConnect

      public void onConnect(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: BrowserLiveReload
      Sets the web socket connection resource when it's established.
      Specified by:
      onConnect in interface BrowserLiveReload
      Parameters:
      resource - a web socket connection resource, not null.
    • onDisconnect

      public void onDisconnect(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: BrowserLiveReload
      Removes the web socket connection resource, not null.
      Specified by:
      onDisconnect in interface BrowserLiveReload
      Parameters:
      resource - a web socket connection resource
    • isLiveReload

      public boolean isLiveReload(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: BrowserLiveReload
      Returns whether the passed connection is a browser live-reload connection.
      Specified by:
      isLiveReload in interface BrowserLiveReload
      Parameters:
      resource - a web socket connection resource, not null.
      Returns:
      whether the web socket connection is for live reload
    • broadcast

      public void broadcast(elemental.json.JsonObject msg)
      Broadcasts the given message to all connected clients.
      Parameters:
      msg - the message to broadcast
    • reload

      public void reload()
      Description copied from interface: BrowserLiveReload
      Requests reload via the resource provided via BrowserLiveReload.onConnect(AtmosphereResource) call.
      Specified by:
      reload in interface BrowserLiveReload
    • refresh

      public void refresh(boolean refreshLayouts)
      Description copied from interface: BrowserLiveReload
      Requests a refresh of the current view in the browser, without reloading the whole page.
      Specified by:
      refresh in interface BrowserLiveReload
      Parameters:
      refreshLayouts - true to refresh all layouts in the route chain, false to only refresh the route component
    • update

      public void update(String path, String content)
      Description copied from interface: BrowserLiveReload
      Request an update of the resource with the given path.
      Specified by:
      update in interface BrowserLiveReload
      Parameters:
      path - the path of the file to update, relative to the servlet path
      content - the new content of the file
    • onMessage

      public void onMessage(org.atmosphere.cpr.AtmosphereResource resource, String message)
      Description copied from interface: BrowserLiveReload
      Called when any message is received through the connection.
      Specified by:
      onMessage in interface BrowserLiveReload
      Parameters:
      resource - the atmosphere resource that received the message
      message - the received message
    • getOrCreateFragmentedMessage

      public AtmospherePushConnection.FragmentedMessage getOrCreateFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: FragmentedMessageHolder
      Gets the partial message that is currently being received, if any.
      Specified by:
      getOrCreateFragmentedMessage in interface FragmentedMessageHolder
      Parameters:
      resource - the resource to get the partial message from
      Returns:
      the fragmented message being received or a new empty instance
    • clearFragmentedMessage

      public void clearFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: FragmentedMessageHolder
      Clears the partial message that is currently being received. Should be called when the whole message has been received.
      Specified by:
      clearFragmentedMessage in interface FragmentedMessageHolder
      Parameters:
      resource - the related resource
    • sendHmrEvent

      public void sendHmrEvent(String event, elemental.json.JsonObject eventData)
      Description copied from interface: BrowserLiveReload
      Send a client side HMR event.
      Specified by:
      sendHmrEvent in interface BrowserLiveReload
      Parameters:
      event - the event name
      eventData - the event data