WebSocketHandler and its session.
| Modifier and Type | Field and Description |
|---|---|
| private final WebSocketHandler | |
| private StandardWebSocketSession | |
| private final Function |
| Access | Constructor and Description |
|---|---|
| public | StandardWebSocketHandlerAdapter(WebSocketHandler handler, Function<Session, StandardWebSocketSession> sessionFactory)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | onClose(Session
The session session, CloseReason Why the session was closed reason)Overrides jakarta. Event that is triggered when a session has closed. |
| public void | onError(Session
The session. session, Throwable The exception. exception)Overrides jakarta. Event that is triggered when a protocol error occurs. |
| public void | onOpen(Session
The new session. session, EndpointConfig The configuration with which the Endpoint was configured. config)Implements abstract jakarta. Event that is triggered when a new session starts. |
| private <T> WebSocketMessage |
| delegateHandler | back to summary |
|---|---|
| private final WebSocketHandler delegateHandler | |
| delegateSession | back to summary |
|---|---|
| private StandardWebSocketSession delegateSession
| |
| sessionFactory | back to summary |
|---|---|
| private final Function<Session, StandardWebSocketSession> sessionFactory | |
| StandardWebSocketHandlerAdapter | back to summary |
|---|---|
| public StandardWebSocketHandlerAdapter(WebSocketHandler handler, Function<Session, StandardWebSocketSession> sessionFactory) | |
| onClose | back to summary |
|---|---|
| public void onClose(Session session, CloseReason reason) Overrides jakarta. Doc from jakarta. Event that is triggered when a session has closed.
| |
| onError | back to summary |
|---|---|
| public void onError(Session session, Throwable exception) Overrides jakarta. Doc from jakarta. Event that is triggered when a protocol error occurs. | |
| onOpen | back to summary |
|---|---|
| public void onOpen(Session session, EndpointConfig config) Implements abstract jakarta. Doc from jakarta. Event that is triggered when a new session starts.
| |
| toMessage | back to summary |
|---|---|
| private <T> WebSocketMessage toMessage(T message) | |