Class CometServerPush

java.lang.Object
org.zkoss.zkex.ui.comet.CometServerPush
org.zkoss.zkmax.ui.comet.CometServerPush
All Implemented Interfaces:
org.zkoss.zk.ui.sys.ServerPush

public class CometServerPush extends org.zkoss.zkex.ui.comet.CometServerPush
ZK Comet that supports Servlet 3 asynchronous processing. This implementation will detect if the server supports Servlet 3, and then use the right implementation automatically.
Since:
6.0.0
Author:
tomyeh
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.zkoss.zkex.ui.comet.CometServerPush

    org.zkoss.zkex.ui.comet.CometServerPush.AsyncInfo, org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo
  • Constructor Summary

    Constructors
    Constructor
    Description
    The default constructor.
    CometServerPush(boolean async)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    beforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info)
     
    protected String
     
    protected String
     
    protected void
     
    protected void
    processRequest(org.zkoss.zk.ui.Execution exec, org.zkoss.zkex.ui.comet.CometServerPush.AsyncInfo ai)
    Called when receiving the comet request from the client.
    protected boolean
     
    void
    start(org.zkoss.zk.ui.Desktop desktop)
     

    Methods inherited from class org.zkoss.zkex.ui.comet.CometServerPush

    activate, deactivate, getDesktop, getIntPref, getStartScript, isActive, onPiggyback, onStop, resume, schedule, startClientPush, stop, stopClientPush

    Methods inherited from class java.lang.Object

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

    • CometServerPush

      public CometServerPush()
      The default constructor. It detects if the server supports Servlet 3, and then use the right implementation accordingly.

      If you prefer to disable the use of Servlet 3 or vice versa, you could specify a library property called org.zkoss.zkmax.ui.comet.async.disabled. Notice that enabling the asynchronous support in a server not supporting Servlet 3 is not allowed.

    • CometServerPush

      public CometServerPush(boolean async)
      Parameters:
      async - whether to utilities Servlet 3 asynchronous processing support. Don't specify it to true if the server doesn't support Servlet 3. The result is unpredictable.
  • Method Details

    • start

      public void start(org.zkoss.zk.ui.Desktop desktop)
      Specified by:
      start in interface org.zkoss.zk.ui.sys.ServerPush
      Overrides:
      start in class org.zkoss.zkex.ui.comet.CometServerPush
    • getStartScript

      protected String getStartScript()
      Overrides:
      getStartScript in class org.zkoss.zkex.ui.comet.CometServerPush
    • getStopScript

      protected String getStopScript()
      Overrides:
      getStopScript in class org.zkoss.zkex.ui.comet.CometServerPush
    • onStart

      protected void onStart()
      Overrides:
      onStart in class org.zkoss.zkex.ui.comet.CometServerPush
    • setBusy

      protected boolean setBusy()
      Overrides:
      setBusy in class org.zkoss.zkex.ui.comet.CometServerPush
    • processRequest

      protected void processRequest(org.zkoss.zk.ui.Execution exec, org.zkoss.zkex.ui.comet.CometServerPush.AsyncInfo ai) throws IOException
      Called when receiving the comet request from the client.
      Overrides:
      processRequest in class org.zkoss.zkex.ui.comet.CometServerPush
      Throws:
      IOException
    • beforeUpdate

      protected void beforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info)
      Overrides:
      beforeUpdate in class org.zkoss.zkex.ui.comet.CometServerPush