java.lang.Object
org.omnifaces.cdi.push.SocketFacesListener
- All Implemented Interfaces:
FacesListener,SystemEventListener,EventListener
This Faces listener for UIViewRoot ensures that the necessary JavaScript code to open or close the
WebSocket is properly rendered.
- Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisListenerForSource(Object source) Only listens onUIViewRoot.voidprocessEvent(SystemEvent event) If the socket has just switched theconnectedattribute, then render either theopen()script or theclose()script.
-
Constructor Details
-
SocketFacesListener
public SocketFacesListener()
-
-
Method Details
-
isListenerForSource
Only listens onUIViewRoot.- Specified by:
isListenerForSourcein interfaceSystemEventListener
-
processEvent
If the socket has just switched theconnectedattribute, then render either theopen()script or theclose()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 withtarget="body". Those scripts will in turn hitSocketEndpoint.- Specified by:
processEventin interfaceSystemEventListener
-