public class JettyWebSocketHandlerAdapter
extends java.lang.Object
@WebSocket
handler that delegates events to a
reactive WebSocketHandler
and its session.Modifier and Type | Field and Description |
---|---|
private WebSocketHandler |
delegateHandler |
private JettyWebSocketSession |
delegateSession |
private static java.nio.ByteBuffer |
EMPTY_PAYLOAD |
private java.util.function.Function<Session,JettyWebSocketSession> |
sessionFactory |
Constructor and Description |
---|
JettyWebSocketHandlerAdapter(WebSocketHandler handler,
java.util.function.Function<Session,JettyWebSocketSession> sessionFactory) |
Modifier and Type | Method and Description |
---|---|
void |
onWebSocketBinary(byte[] message,
int offset,
int length) |
void |
onWebSocketClose(int statusCode,
java.lang.String reason) |
void |
onWebSocketConnect(Session session) |
void |
onWebSocketError(java.lang.Throwable cause) |
void |
onWebSocketFrame(Frame frame) |
void |
onWebSocketText(java.lang.String message) |
private <T> WebSocketMessage |
toMessage(WebSocketMessage.Type type,
T message) |
private static final java.nio.ByteBuffer EMPTY_PAYLOAD
private final WebSocketHandler delegateHandler
private final java.util.function.Function<Session,JettyWebSocketSession> sessionFactory
private JettyWebSocketSession delegateSession
public JettyWebSocketHandlerAdapter(WebSocketHandler handler, java.util.function.Function<Session,JettyWebSocketSession> sessionFactory)
public void onWebSocketConnect(Session session)
public void onWebSocketText(java.lang.String message)
public void onWebSocketBinary(byte[] message, int offset, int length)
public void onWebSocketFrame(Frame frame)
private <T> WebSocketMessage toMessage(WebSocketMessage.Type type, T message)
public void onWebSocketClose(int statusCode, java.lang.String reason)
public void onWebSocketError(java.lang.Throwable cause)