java.lang.Object
com.sun.faces.push.WebsocketChannelManager
- All Implemented Interfaces:
Serializable
This web socket channel manager holds all application and session scoped web socket channel identifiers registered by
<f:websocket>
.
- Since:
- 2.3
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This helps the web socket channel manager to hold view scoped web socket channel identifiers registered by<f:websocket>
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
When current session scope is about to be destroyed, deregister all session scope channels and explicitly close any open web sockets associated with it to avoid stale websockets.register
(FacesContext context, String channel, String scope, Serializable user) Register given channel on given scope and returns the web socket channel identifier.
-
Constructor Details
-
WebsocketChannelManager
public WebsocketChannelManager()
-
-
Method Details
-
register
Register given channel on given scope and returns the web socket channel identifier.- Parameters:
context
- The involved faces context.channel
- The web socket channel.scope
- The web socket scope. Supported values areapplication
,session
andview
, case insensitive. Ifnull
, the default isapplication
.user
- The user object representing the owner of the given channel. If notnull
, then scope may not beapplication
.- Returns:
- The web socket URL.
- Throws:
IllegalArgumentException
- When the scope is invalid or when channel already exists on a different scope.
-
deregisterSessionScope
When current session scope is about to be destroyed, deregister all session scope channels and explicitly close any open web sockets associated with it to avoid stale websockets. If any, also deregister session users.
-