Package org.zkoss.zkmax.ui.comet
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info) protected Stringprotected Stringprotected voidonStart()protected voidprocessRequest(org.zkoss.zk.ui.Execution exec, org.zkoss.zkex.ui.comet.CometServerPush.AsyncInfo ai) Called when receiving the comet request from the client.protected booleansetBusy()voidstart(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
-
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:
startin interfaceorg.zkoss.zk.ui.sys.ServerPush- Overrides:
startin classorg.zkoss.zkex.ui.comet.CometServerPush
-
getStartScript
- Overrides:
getStartScriptin classorg.zkoss.zkex.ui.comet.CometServerPush
-
getStopScript
- Overrides:
getStopScriptin classorg.zkoss.zkex.ui.comet.CometServerPush
-
onStart
protected void onStart()- Overrides:
onStartin classorg.zkoss.zkex.ui.comet.CometServerPush
-
setBusy
protected boolean setBusy()- Overrides:
setBusyin classorg.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:
processRequestin classorg.zkoss.zkex.ui.comet.CometServerPush- Throws:
IOException
-
beforeUpdate
protected void beforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info) - Overrides:
beforeUpdatein classorg.zkoss.zkex.ui.comet.CometServerPush
-