Class WebsocketViewBean

  • All Implemented Interfaces:
    Serializable

    @ViewScoped
    public class WebsocketViewBean
    extends Object
    implements Serializable
    The purpose of this view scope bean is keep track of the channelTokens used in this view and if the view is discarded, destroy the websocket sessions associated with the view because they are no longer valid.
    See Also:
    Serialized Form
    • Constructor Detail

      • WebsocketViewBean

        public WebsocketViewBean()
    • Method Detail

      • isChannelAvailable

        public boolean isChannelAvailable​(String channel)
        Indicate if the channel mentioned is valid for view scope. A channel is valid if there is at least one token that represents a valid connection to this channel.
        Parameters:
        channel -
        Returns:
      • getChannelTokensFor

        public List<String> getChannelTokensFor​(String channel)
      • destroy

        @PreDestroy
        public void destroy()