@SessionScoped public class WebsocketChannelManager extends Object implements Serializable
This web socket channel manager holds all application and session scoped web socket channel identifiers registered by
<f:websocket>
.
Push
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
WebsocketChannelManager.ViewScope
This helps the web socket channel manager to hold view scoped web socket channel identifiers registered by
<f:websocket> . |
Constructor and Description |
---|
WebsocketChannelManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
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.
|
String |
register(FacesContext context,
String channel,
String scope,
Serializable user)
Register given channel on given scope and returns the web socket channel identifier.
|
public String register(FacesContext context, String channel, String scope, Serializable user)
context
- The involved faces context.channel
- The web socket channel.scope
- The web socket scope. Supported values are application
, session
and
view
, case insensitive. If null
, the default is application
.user
- The user object representing the owner of the given channel. If not null
, then scope
may not be application
.IllegalArgumentException
- When the scope is invalid or when channel already exists on a different scope.@PreDestroy protected void deregisterSessionScope()
Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.