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 the AjaxCallPushData.getActionListener().
Since:
7.0.0
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • BackendPushContextBean

      public BackendPushContextBean()
  • Method Details

    • 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.