Interface BrowserLiveReload

All Superinterfaces:
FragmentedMessageHolder, Serializable
All Known Implementing Classes:
DebugWindowConnection

public interface BrowserLiveReload extends FragmentedMessageHolder
Provides a way to reload browser tabs via web socket connection passed as a AtmosphereResource.

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

Author:
Vaadin Ltd
  • Method Details

    • getBackend

      Detects and return enabling live reload backend technology.
      Returns:
      enabling technology, or null if none
    • setBackend

      void setBackend(BrowserLiveReload.Backend backend)
      Sets the live reload backend technology explicitly.
      Parameters:
      backend - enabling technology, not null.
    • onConnect

      void onConnect(org.atmosphere.cpr.AtmosphereResource resource)
      Sets the web socket connection resource when it's established.
      Parameters:
      resource - a web socket connection resource, not null.
    • onDisconnect

      void onDisconnect(org.atmosphere.cpr.AtmosphereResource resource)
      Removes the web socket connection resource, not null.
      Parameters:
      resource - a web socket connection resource
    • isLiveReload

      boolean isLiveReload(org.atmosphere.cpr.AtmosphereResource resource)
      Returns whether the passed connection is a browser live-reload connection.
      Parameters:
      resource - a web socket connection resource, not null.
      Returns:
      whether the web socket connection is for live reload
    • reload

      void reload()
      Requests reload via the resource provided via onConnect(AtmosphereResource) call.
    • update

      void update(String path, String content)
      Request an update of the resource with the given path.
      Parameters:
      path - the path of the file to update, relative to the servlet path
      content - the new content of the file
    • onMessage

      void onMessage(org.atmosphere.cpr.AtmosphereResource resource, String msg)
      Called when any message is received through the connection.
      Parameters:
      resource - the atmosphere resource that received the message
      msg - the received message