Class BackendPushContextBean

    • Constructor Detail

      • BackendPushContextBean

        public BackendPushContextBean()
    • 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.