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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactivate(long timeout) booleandeactivate(boolean stop) booleanisActive()voidvoidresume()<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 voidSends an AU response to the client to start the server push.voidstop()protected void
-
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:
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 InterruptedException, org.zkoss.zk.ui.DesktopUnavailableException - Specified by:
activatein interfaceorg.zkoss.zk.ui.sys.ServerPush- Throws:
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
-