Package org.apache.myfaces.push.cdi
Class WebsocketScopeManager.ViewScope
- java.lang.Object
-
- org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractScope
-
- org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractUserScope
-
- org.apache.myfaces.push.cdi.WebsocketScopeManager.ViewScope
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- WebsocketScopeManager
@ViewScoped public static class WebsocketScopeManager.ViewScope extends WebsocketScopeManager.AbstractUserScope implements Serializable
This map hold all tokens related to the current view. The reason to do this is the connections must follow the same rules the view has, so if a view is disposed, all related websocket sessions must be disposed too on the server, and in that way we can avoid memory leaks. This bean has a PreDestroy annotation to dispose all related websocket sessions. This map also enforces a rule that there is only one websocket token pero combination of channel, scope and user per view. In that way, the token can be used to identify on the client if a websocket initialization request can share a websocket connection or not, simplifying code design.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractUserScope
tokens
-
Fields inherited from class org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractScope
channelTokens
-
-
Constructor Summary
Constructors Constructor Description ViewScope()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
-
Methods inherited from class org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractUserScope
getChannelToken, getUserFromChannelToken, isTokenValid, registerToken
-
Methods inherited from class org.apache.myfaces.push.cdi.WebsocketScopeManager.AbstractScope
getChannelTokens, getChannelTokens, isChannelAvailable, registerWebsocketSession
-
-