public class SocketFacesListener extends Object implements SystemEventListener
This JSF listener for UIViewRoot ensures that the necessary JavaScript code to open or close the
WebSocket is properly rendered.
Socket| Constructor and Description |
|---|
SocketFacesListener() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isListenerForSource(Object source)
Only listens on
UIViewRoot. |
void |
processEvent(SystemEvent event)
If the socket has just switched the
connected attribute, then render either the open()
script or the close() script. |
public boolean isListenerForSource(Object source)
UIViewRoot.isListenerForSource in interface SystemEventListenerpublic void processEvent(SystemEvent event)
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". Those scripts will in turn hit SocketEndpoint.processEvent in interface SystemEventListenerCopyright © 2012–2021 OmniFaces. All rights reserved.