@Beta public interface EndpointEventListener
| Modifier and Type | Field and Description |
|---|---|
static EndpointEventListener |
NO_OP
An instance of @EndpointEventListener that does not do anything.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onError(java.lang.String sessionId,
java.lang.Throwable t)
Called when an error has occurred.
|
void |
onSessionClosed(java.lang.String sessionId)
Called when a session has been closed.
|
MessageEventListener |
onSessionOpened(java.lang.String sessionId)
Called when a session has been opened.
|
static final EndpointEventListener NO_OP
MessageEventListener onSessionOpened(java.lang.String sessionId)
sessionId - an ID of the newly opened session.void onSessionClosed(java.lang.String sessionId)
sessionId - an ID of the closed session.void onError(java.lang.String sessionId,
java.lang.Throwable t)
Errors that occur either during Endpoint.onOpen(jakarta.websocket.Session,
jakarta.websocket.EndpointConfig), Endpoint.onClose(jakarta.websocket.Session,
jakarta.websocket.CloseReason) and their annotated equivalent or when handling an incoming message, cause this
listener to be called. It corresponds to the event of invocation of (jakarta.websocket.Session, Throwable) and its annotated equivalent.
sessionId - an ID of the session on which the error occurred.t - throwable that has been thrown.Copyright © 2012–2020 Oracle Corporation. All rights reserved.