Class 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
    • Constructor Detail

      • ViewScope

        public ViewScope()
    • Method Detail

      • destroy

        @PreDestroy
        public void destroy()