public class WebsocketEndpoint
extends jakarta.websocket.Endpoint
This web socket server endpoint handles web socket requests coming from <f:websocket>.
Push| Modifier and Type | Field and Description |
|---|---|
static String |
URI_TEMPLATE
The context-relative URI template where the web socket endpoint should listen on.
|
| Constructor and Description |
|---|
WebsocketEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
onClose(jakarta.websocket.Session session,
jakarta.websocket.CloseReason reason)
Remove given web socket session from the
WebsocketSessionManager. |
void |
onError(jakarta.websocket.Session session,
Throwable throwable)
Delegate exception to onClose.
|
void |
onOpen(jakarta.websocket.Session session,
jakarta.websocket.EndpointConfig config)
Add given web socket session to the
WebocketSessionManager. |
public static final String URI_TEMPLATE
public void onOpen(jakarta.websocket.Session session,
jakarta.websocket.EndpointConfig config)
WebocketSessionManager. If web socket session is not accepted (i.e. the
channel identifier is unknown), then immediately close with reason VIOLATED_POLICY (close code 1008).onOpen in class jakarta.websocket.Endpointsession - The opened web socket session.config - The endpoint configuration.public void onError(jakarta.websocket.Session session,
Throwable throwable)
onError in class jakarta.websocket.Endpointsession - The errored web socket session.throwable - The cause.public void onClose(jakarta.websocket.Session session,
jakarta.websocket.CloseReason reason)
WebsocketSessionManager. If there is any exception from onError
which was not caused by GOING_AWAY, then log it. Tomcat <= 8.0.30 is known to throw an unnecessary exception when
client abruptly disconnects, see also issue 57489.onClose in class jakarta.websocket.Endpointsession - The closed web socket session.reason - The close reason.Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.