Package org.zkoss.zkmax.au.websocket
Class WebSocketWebAppInit
- java.lang.Object
-
- org.zkoss.zkmax.au.websocket.WebSocketWebAppInit
-
- All Implemented Interfaces:
WebAppCleanup
,WebAppInit
public class WebSocketWebAppInit extends java.lang.Object implements WebAppInit, WebAppCleanup
A WebAppInit implementation for WebSocket connection. Available in ZK EE. In WEB-INF/zk.xml, add following lines to enable WebSocket connection:
To change the update URL, you could also add the following lines into WEB-INF/zk.xml. (Optional) If not specified, "/zkwm" will be used by default.<listener> <listener-class>org.zkoss.zkmax.au.websocket.WebSocketWebAppInit</listener-class> </listener>
When WebSocket connection is enabled, we'll use WebSocketServerPush by default when server-push started. Note that we cannot guarantee the accessing of the information provided by http requests when WebSocket connection is enabled.<library-property> <name>org.zkoss.zkmax.au.websocket.WebSocketEndPoint.urlPattern</name> <value>/yourApp</value> </library-property>
- Since:
- 8.5.0
- Author:
- wenninghsu
-
-
Constructor Summary
Constructors Constructor Description WebSocketWebAppInit()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup(WebApp wapp)
called when a ZK application is about to be destroyed.static java.lang.String
getWebSocketUrl()
Returns websocket url.void
init(WebApp wapp)
Called when a ZK application is created and initialized.static boolean
isFilterInstalled(WebApp wapp)
Returns whether the websocket filter has been installed.
-
-
-
Method Detail
-
init
public void init(WebApp wapp) throws java.lang.Exception
Description copied from interface:WebAppInit
Called when a ZK application is created and initialized.You could retrieve the servlet context by
WebApp.getServletContext()
- Specified by:
init
in interfaceWebAppInit
- Throws:
java.lang.Exception
-
isFilterInstalled
public static boolean isFilterInstalled(WebApp wapp)
Returns whether the websocket filter has been installed.- Since:
- 8.5.1
-
getWebSocketUrl
public static java.lang.String getWebSocketUrl()
Returns websocket url.- Since:
- 8.5.1
-
cleanup
public void cleanup(WebApp wapp) throws java.lang.Exception
Description copied from interface:WebAppCleanup
called when a ZK application is about to be destroyed.If this method throws an exception, the error message is only logged (user won't see it).
- Specified by:
cleanup
in interfaceWebAppCleanup
- Throws:
java.lang.Exception
-
-