public class SocketFacesListener extends Object implements SystemEventListener
This JSF listener for
WebSocket is properly rendered.
|Constructor and Description|
Construct an instance of socket event listener based on the given channel, uri, functions and connected expression.
|Modifier and Type||Method and Description|
Only listens on
If event is an instance of
public SocketFacesListener(Integer port, String channel, String uri, String functions, ValueExpression connectedExpression)
port- The port number.
channel- The channel name.
uri- The uri of the web socket representing the channel identifier, which is composed of channel name and scope identifier, separated by a question mark. All open websockets on the same uri will receive the same push notification from the server.
functions- The onopen, onmessage and onclose functions.
connectedExpression- The connected expression.
public boolean isListenerForSource(Object source)
public void processEvent(SystemEvent event)
PostAddToViewEvent, then add the main
omnifaces.jsscript resource. Else if event is an instance of
PreRenderViewEvent, and the socket is new, then render the
init()script, or if it has just switched the
connectedattribute, 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
Copyright © 2012–2016 OmniFaces. All rights reserved.