Class WebsocketFacesListener

    • Constructor Detail

      • WebsocketFacesListener

        public WebsocketFacesListener()
    • Method Detail

      • subscribeIfNecessary

        public static void subscribeIfNecessary​(FacesContext context)
      • isListenerForSource

        public boolean isListenerForSource​(Object source)
        Only listens on UIViewRoot.
        Specified by:
        isListenerForSource in interface SystemEventListener
        Parameters:
        source - the source that is inquiring about the appropriateness of sending an event to this listener instance.
        Returns:
        the value as specified above
      • processEvent

        public void processEvent​(SystemEvent event)
                          throws AbortProcessingException
        If the websocket has just switched its rendered or connected attribute, then render either the open() script or the close() script. During an ajax request with partial rendering, it's added as <eval> by partial response writer, else it's just added as a script component with target="body".
        Specified by:
        processEvent in interface SystemEventListener
        Parameters:
        event - the SystemEvent instance that is being processed.
        Throws:
        AbortProcessingException - if lifecycle processing should cease for this request.