Class WebSocketServerPush

java.lang.Object
org.zkoss.zkmax.au.websocket.WebSocketServerPush
All Implemented Interfaces:
org.zkoss.zk.ui.sys.ServerPush

public class WebSocketServerPush extends Object implements org.zkoss.zk.ui.sys.ServerPush
A server-push implementation that is based on WebSocket. This is the default server-push class when WebSocket connection is enabled. To enable WebSocket connection, please refer to WebSocketWebAppInit for more information.
Since:
8.5.0
Author:
wenninghsu
  • Constructor Details

    • WebSocketServerPush

      public WebSocketServerPush()
  • Method Details

    • setReady

      public void setReady(boolean ready)
    • setWebSocketConnectionInfos

      protected void setWebSocketConnectionInfos(WebSocketEndPoint webSocketEndpoint, jakarta.servlet.http.HttpServletRequest request)
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.zkoss.zk.ui.sys.ServerPush
    • start

      public void start(org.zkoss.zk.ui.Desktop desktop)
      Specified by:
      start in interface org.zkoss.zk.ui.sys.ServerPush
    • stop

      public void stop()
      Specified by:
      stop in interface org.zkoss.zk.ui.sys.ServerPush
    • resume

      public void resume()
      Specified by:
      resume in interface org.zkoss.zk.ui.sys.ServerPush
    • startClientPush

      protected void startClientPush()
      Sends an AU response to the client to start the server push. It is called by start(org.zkoss.zk.ui.Desktop).

      The derived class usually overrides this method to support different devices.

      The default implementation is to send an AuScript response.

    • schedule

      public <T extends org.zkoss.zk.ui.event.Event> void schedule(org.zkoss.zk.ui.event.EventListener<T> listener, T event, org.zkoss.zk.ui.sys.Scheduler<T> scheduler)
      Specified by:
      schedule in interface org.zkoss.zk.ui.sys.ServerPush
    • activate

      public boolean activate(long timeout) throws InterruptedException, org.zkoss.zk.ui.DesktopUnavailableException
      Specified by:
      activate in interface org.zkoss.zk.ui.sys.ServerPush
      Throws:
      InterruptedException
      org.zkoss.zk.ui.DesktopUnavailableException
    • deactivate

      public boolean deactivate(boolean stop)
      Specified by:
      deactivate in interface org.zkoss.zk.ui.sys.ServerPush
    • wakePending

      protected void wakePending()
    • onPiggyback

      public void onPiggyback()
      Specified by:
      onPiggyback in interface org.zkoss.zk.ui.sys.ServerPush