Package org.apache.myfaces.push.cdi
Class WebsocketApplicationSessionHolder
- java.lang.Object
-
- org.apache.myfaces.push.cdi.WebsocketApplicationSessionHolder
-
public final class WebsocketApplicationSessionHolder extends Object
-
-
Constructor Summary
Constructors Constructor Description WebsocketApplicationSessionHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaddOrUpdateSession(String channelToken, jakarta.websocket.Session session)static voidclearWebsocketSessionLRUCache()Removes the cached MetadataTarget instances in order to prevent a memory leak.static Queue<String>getRestoredQueue()static ConcurrentLRUCache<String,Reference<jakarta.websocket.Session>>getWebsocketSessionLRUCache()static voidinitWebsocketSessionLRUCache(ExternalContext context)static booleanremoveSession(String channelToken)Remove the Session associated to the channelToken.protected static Set<Future<Void>>send(String channelToken, Object message)
-
-
-
Method Detail
-
getWebsocketSessionLRUCache
public static ConcurrentLRUCache<String,Reference<jakarta.websocket.Session>> getWebsocketSessionLRUCache()
-
initWebsocketSessionLRUCache
public static void initWebsocketSessionLRUCache(ExternalContext context)
-
clearWebsocketSessionLRUCache
public static void clearWebsocketSessionLRUCache()
Removes the cached MetadataTarget instances in order to prevent a memory leak.
-
addOrUpdateSession
public static boolean addOrUpdateSession(String channelToken, jakarta.websocket.Session session)
-
removeSession
public static boolean removeSession(String channelToken)
Remove the Session associated to the channelToken. This happens when the websocket connection is closed. Please note the connection can be closed/reopened, so this method should not block another connection using the same channelToken. To destroy the channel token, WebsocketViewBean is used to destroy the channel token at view expiration time.- Parameters:
channelToken-- Returns:
-
-