- java.lang.Object
-
- org.omnifaces.cdi.push.SocketFacesListener
-
- All Implemented Interfaces:
FacesListener,SystemEventListener,EventListener
public class SocketFacesListener extends Object implements SystemEventListener
This Faces listener for
UIViewRootensures that the necessary JavaScript code to open or close theWebSocketis properly rendered.- Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
Socket
-
-
Constructor Summary
Constructors Constructor Description SocketFacesListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisListenerForSource(Object source)Only listens onUIViewRoot.voidprocessEvent(SystemEvent event)If the socket has just switched theconnectedattribute, then render either theopen()script or theclose()script.
-
-
-
Method Detail
-
isListenerForSource
public boolean isListenerForSource(Object source)
Only listens onUIViewRoot.- Specified by:
isListenerForSourcein interfaceSystemEventListener
-
processEvent
public void processEvent(SystemEvent event)
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
-
-