public class WebsocketFacesListener extends Object implements javax.faces.event.SystemEventListener
This JSF 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(javax.faces.context.FacesContext context,
javax.faces.component.UIWebsocket websocket) |
void |
processEvent(javax.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(javax.faces.context.FacesContext context) |
public static void subscribeIfNecessary(javax.faces.context.FacesContext context)
public static boolean isNew(javax.faces.context.FacesContext context,
javax.faces.component.UIWebsocket websocket)
public boolean isListenerForSource(Object source)
UIViewRoot.isListenerForSource in interface javax.faces.event.SystemEventListenersource - the source that is inquiring about the
appropriateness of sending an event to this listener instance.public void processEvent(javax.faces.event.SystemEvent event)
throws javax.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 javax.faces.event.SystemEventListenerevent - the SystemEvent instance that
is being processed.javax.faces.event.AbortProcessingException - if lifecycle processing should
cease for this request.Copyright © 2010–2024 JBoss by Red Hat. All rights reserved.