This web socket session manager holds all web socket sessions by their channel identifier.
Push
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static volatile WebsocketSessionManager | |
| private static final Logger | |
| private static final CloseReason | |
| private static final AnnotationLiteral | |
| private static final AnnotationLiteral | |
| private final ConcurrentMap | |
| private WebsocketUserManager | |
| private static final long | |
| private static final long | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: true if given web socket session is accepted and is new, otherwise false.The opened web socket session. session)On open, add given web socket session to the mapping associated with its channel identifier and returns
|
| protected void | deregister(Iterable<String>
The channel identifiers to deregister. channelIds)Deregister given channel identifiers and explicitly close all open web socket sessions associated with it. |
| private static void | |
| private static String | |
| private static String | |
| pack-priv static WebsocketSessionManager | |
| protected void | |
| protected void | |
| protected void | remove(Session
The closed web socket session. session, CloseReason The close reason. reason)On close, remove given web socket session from the mapping. |
| private Void | |
| protected Set | Returns: The results of the send operation. If it returns an empty set, then there was no open session associated with given channel identifier. The returned futures will returnnull on Future#get() if the message
was successfully delivered and otherwise throw ExecutionException.The web socket channel identifier. channelId, String The push message string. message)Encode the given message object as JSON and send it to all open web socket sessions associated with given web socket channel identifier. |
| private Future |
| ERROR_TOMCAT_WEB_SOCKET_BOMBED | back to summary |
|---|---|
| private static final String ERROR_TOMCAT_WEB_SOCKET_BOMBED | |
| instance | back to summary |
|---|---|
| private static volatile WebsocketSessionManager instance | |
| logger | back to summary |
|---|---|
| private static final Logger logger | |
| REASON_EXPIRED | back to summary |
|---|---|
| private static final CloseReason REASON_EXPIRED | |
| SESSION_CLOSED | back to summary |
|---|---|
| private static final AnnotationLiteral<WebsocketEvent. | |
| SESSION_OPENED | back to summary |
|---|---|
| private static final AnnotationLiteral<WebsocketEvent. | |
| socketSessions | back to summary |
|---|---|
| private final ConcurrentMap<String, Collection<Session>> socketSessions | |
| socketUsers | back to summary |
|---|---|
| private WebsocketUserManager socketUsers
| |
| TOMCAT_WEB_SOCKET_MAX_RETRIES | back to summary |
|---|---|
| private static final long TOMCAT_WEB_SOCKET_MAX_RETRIES | |
| TOMCAT_WEB_SOCKET_RETRY_TIMEOUT | back to summary |
|---|---|
| private static final long TOMCAT_WEB_SOCKET_RETRY_TIMEOUT | |
| WARNING_TOMCAT_WEB_SOCKET_BOMBED | back to summary |
|---|---|
| private static final String WARNING_TOMCAT_WEB_SOCKET_BOMBED | |
| WebsocketSessionManager | back to summary |
|---|---|
| public WebsocketSessionManager() | |
| add | back to summary |
|---|---|
| protected boolean add(Session session) On open, add given web socket session to the mapping associated with its channel identifier and returns
| |
| deregister | back to summary |
|---|---|
| protected void deregister(Iterable<String> channelIds) Deregister given channel identifiers and explicitly close all open web socket sessions associated with it. | |
| fireEvent | back to summary |
|---|---|
| private static void fireEvent(Session session, CloseReason reason, AnnotationLiteral<?> qualifier) | |
| getChannel | back to summary |
|---|---|
| private static String getChannel(Session session) | |
| getChannelId | back to summary |
|---|---|
| private static String getChannelId(Session session) | |
| getInstance | back to summary |
|---|---|
| pack-priv static WebsocketSessionManager getInstance() Internal usage only. Awkward workaround for it being unavailable via @Inject in endpoint in Tomcat+Weld/OWB. | |
| register | back to summary |
|---|---|
| protected void register(String channelId) Register given channel identifier.
| |
| register | back to summary |
|---|---|
| protected void register(Iterable<String> channelIds) Register given channel identifiers. | |
| remove | back to summary |
|---|---|
| protected void remove(Session session, CloseReason reason) On close, remove given web socket session from the mapping.
| |
| retrySendTomcatWebSocket | back to summary |
|---|---|
| private Void retrySendTomcatWebSocket(Session session, String text) | |
| send | back to summary |
|---|---|
| protected Set Encode the given message object as JSON and send it to all open web socket sessions associated with given web socket channel identifier.
| |
| send | back to summary |
|---|---|
| private Future | |