@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(String sessionId,
Throwable t)
Called when an error has occurred.
|
void |
onSessionClosed(String sessionId)
Called when a session has been closed.
|
MessageEventListener |
onSessionOpened(String sessionId)
Called when a session has been opened.
|
static final EndpointEventListener NO_OP
MessageEventListener onSessionOpened(String sessionId)
sessionId
- an ID of the newly opened session.void onSessionClosed(String sessionId)
sessionId
- an ID of the closed session.void onError(String sessionId, Throwable t)
Endpoint.onOpen(javax.websocket.Session,
javax.websocket.EndpointConfig)
, Endpoint.onClose(javax.websocket.Session,
javax.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 (javax.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-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.