Package org.zkoss.zkmax.au.websocket
Class WebSocketServerPush
- java.lang.Object
-
- org.zkoss.zkmax.au.websocket.WebSocketServerPush
-
- All Implemented Interfaces:
org.zkoss.zk.ui.sys.ServerPush
public class WebSocketServerPush extends java.lang.Object implements org.zkoss.zk.ui.sys.ServerPushA 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 toWebSocketWebAppInitfor more information.- Since:
- 8.5.0
- Author:
- wenninghsu
-
-
Constructor Summary
Constructors Constructor Description WebSocketServerPush()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactivate(long timeout)booleandeactivate(boolean stop)booleanisActive()voidonPiggyback()voidresume()<T extends org.zkoss.zk.ui.event.Event>
voidschedule(org.zkoss.zk.ui.event.EventListener<T> listener, T event, org.zkoss.zk.ui.sys.Scheduler<T> scheduler)voidsetReady(boolean ready)protected voidsetWebSocketConnectionInfos(WebSocketEndPoint webSocketEndpoint, jakarta.servlet.http.HttpServletRequest request)voidstart(org.zkoss.zk.ui.Desktop desktop)protected voidstartClientPush()Sends an AU response to the client to start the server push.voidstop()protected voidwakePending()
-
-
-
Method Detail
-
setReady
public void setReady(boolean ready)
-
setWebSocketConnectionInfos
protected void setWebSocketConnectionInfos(WebSocketEndPoint webSocketEndpoint, jakarta.servlet.http.HttpServletRequest request)
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceorg.zkoss.zk.ui.sys.ServerPush
-
start
public void start(org.zkoss.zk.ui.Desktop desktop)
- Specified by:
startin interfaceorg.zkoss.zk.ui.sys.ServerPush
-
stop
public void stop()
- Specified by:
stopin interfaceorg.zkoss.zk.ui.sys.ServerPush
-
resume
public void resume()
- Specified by:
resumein interfaceorg.zkoss.zk.ui.sys.ServerPush
-
startClientPush
protected void startClientPush()
Sends an AU response to the client to start the server push. It is called bystart(org.zkoss.zk.ui.Desktop).The derived class usually overrides this method to support different devices.
The default implementation is to send an
AuScriptresponse.
-
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:
schedulein interfaceorg.zkoss.zk.ui.sys.ServerPush
-
activate
public boolean activate(long timeout) throws java.lang.InterruptedException, org.zkoss.zk.ui.DesktopUnavailableException- Specified by:
activatein interfaceorg.zkoss.zk.ui.sys.ServerPush- Throws:
java.lang.InterruptedExceptionorg.zkoss.zk.ui.DesktopUnavailableException
-
deactivate
public boolean deactivate(boolean stop)
- Specified by:
deactivatein interfaceorg.zkoss.zk.ui.sys.ServerPush
-
wakePending
protected void wakePending()
-
onPiggyback
public void onPiggyback()
- Specified by:
onPiggybackin interfaceorg.zkoss.zk.ui.sys.ServerPush
-
-