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.CometServerPushZK 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
-
-
Constructor Summary
Constructors Constructor Description CometServerPush()The default constructor.CometServerPush(boolean async)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info)protected java.lang.StringgetStartScript()protected java.lang.StringgetStopScript()protected 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)
-
-
-
Constructor Detail
-
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 Detail
-
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
protected java.lang.String getStartScript()
- Overrides:
getStartScriptin classorg.zkoss.zkex.ui.comet.CometServerPush
-
getStopScript
protected java.lang.String 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 java.io.IOExceptionCalled when receiving the comet request from the client.- Overrides:
processRequestin classorg.zkoss.zkex.ui.comet.CometServerPush- Throws:
java.io.IOException
-
beforeUpdate
protected void beforeUpdate(org.zkoss.zkex.ui.comet.CometServerPush.ThreadInfo info)
- Overrides:
beforeUpdatein classorg.zkoss.zkex.ui.comet.CometServerPush
-
-