Package de.xima.fc.gui.common.bean.push
Class BackendPushContextBean
- java.lang.Object
-
- de.xima.fc.gui.common.bean.push.BackendPushContextBean
-
- All Implemented Interfaces:
Serializable
@Named @Dependent public class BackendPushContextBean extends Object implements Serializable
Bean with the action listener for theAjaxCallPushData.getActionListener()
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BackendPushContextBean.ApplicationOmniFacesPushKeepAliveCheck
Keepalive check for the OmniFaces socket, with a mutex scoped to the current application.static class
BackendPushContextBean.SessionOmniFacesPushKeepAliveCheck
Keepalive check for the OmniFaces socket, with a mutex scoped to the current session.static class
BackendPushContextBean.ViewOmniFacesPushKeepAliveCheck
Keepalive check for the OmniFaces socket, with a mutex scoped to the current view.
-
Constructor Summary
Constructors Constructor Description BackendPushContextBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getWebSocketKeepAliveIntervalMillis()
Interval for the websocket keep alive interval, in milliseconds.long
getWebSocketKeepAliveIntervalSeconds()
Interval for the websocket keep alive interval, in seconds.void
handleDefaultAjaxCall(javax.faces.event.ActionEvent event)
Action listener called by the default AJAX call push data source.void
handleOmniFacesKeepAliveRequest()
Handles the keep alive request for the OmniFaces web socket.
-
-
-
Method Detail
-
handleDefaultAjaxCall
public void handleDefaultAjaxCall(javax.faces.event.ActionEvent event)
Action listener called by the default AJAX call push data source.- Parameters:
event
- Action event that occurred.
-
handleOmniFacesKeepAliveRequest
public void handleOmniFacesKeepAliveRequest()
Handles the keep alive request for the OmniFaces web socket. The OmniFaces socket is unidirectional, we can only send messages from the server to the server. In additional, we need access to the view scope to send messages. As such, we use the following approach: Each client makes a POSTBACK request regularly in a defined interval, calling this hander method. This method then send a ping message to keep the websocket alive.Note: This handler is invoked in regular intervals by each view scope. That is, when multiple view (from possibly different users) exist, this handler is called many times. We need to ensure that we do not spam users by sending session and application ping messages for each request from a view scope.
-
getWebSocketKeepAliveIntervalMillis
public long getWebSocketKeepAliveIntervalMillis()
Interval for the websocket keep alive interval, in milliseconds.- Returns:
- The websocket keep alive interval, in milliseconds.
-
getWebSocketKeepAliveIntervalSeconds
public long getWebSocketKeepAliveIntervalSeconds()
Interval for the websocket keep alive interval, in seconds.- Returns:
- The websocket keep alive interval, in seconds.
-
-