public class WebsocketEndpoint
extends javax.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(javax.websocket.Session session,
javax.websocket.CloseReason reason)
Remove given web socket session from the
WebsocketSessionManager . |
void |
onError(javax.websocket.Session session,
Throwable throwable)
Delegate exception to onClose.
|
void |
onOpen(javax.websocket.Session session,
javax.websocket.EndpointConfig config)
Add given web socket session to the
WebocketSessionManager . |
public static final String URI_TEMPLATE
public void onOpen(javax.websocket.Session session, javax.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 javax.websocket.Endpoint
session
- The opened web socket session.config
- The endpoint configuration.public void onError(javax.websocket.Session session, Throwable throwable)
onError
in class javax.websocket.Endpoint
session
- The errored web socket session.throwable
- The cause.public void onClose(javax.websocket.Session session, javax.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 javax.websocket.Endpoint
session
- The closed web socket session.reason
- The close reason.Copyright © 1997–2019 Eclipse Foundation. All rights reserved.