public class WebsocketFacesListener extends Object implements jakarta.faces.event.SystemEventListener
This Faces listener for UIViewRoot ensures that the necessary JavaScript code to open or close the
WebSocket is properly rendered depending on rendered and connected attributes.
Push| Constructor and Description |
|---|
WebsocketFacesListener() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isListenerForSource(Object source)
Only listens on
UIViewRoot. |
static boolean |
isNew(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIWebsocket websocket) |
void |
processEvent(jakarta.faces.event.SystemEvent event)
If the websocket has just switched its
rendered or connected attribute, then render either
the open() script or the close() script. |
static void |
subscribeIfNecessary(jakarta.faces.context.FacesContext context) |
public static void subscribeIfNecessary(jakarta.faces.context.FacesContext context)
public static boolean isNew(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIWebsocket websocket)
public boolean isListenerForSource(Object source)
UIViewRoot.isListenerForSource in interface jakarta.faces.event.SystemEventListenersource - the source that is inquiring about the appropriateness of sending an event to this listener instance.public void processEvent(jakarta.faces.event.SystemEvent event)
throws jakarta.faces.event.AbortProcessingException
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".processEvent in interface jakarta.faces.event.SystemEventListenerevent - the SystemEvent instance that is being processed.jakarta.faces.event.AbortProcessingException - if lifecycle processing should cease for this request.Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.