public abstract class ToStompWebSocketListener extends java.lang.Object implements WebSocketListener, SubProtocolCapable
限定符和类型 | 字段和说明 |
---|---|
protected StompMessageSendingTemplate |
stompMessageSendingTemplate |
SEC_WEBSOCKET_PROTOCOL
构造器和说明 |
---|
ToStompWebSocketListener() |
ToStompWebSocketListener(StompListener listener) |
限定符和类型 | 方法和说明 |
---|---|
void |
addListener(StompListener... listeners) |
protected void |
doSend(WebSocket socket,
Message message) |
java.lang.String |
getSubProtocols(java.util.Collection<java.lang.String> requestProtocols) |
void |
onClose(WebSocket socket)
连接关闭时
|
void |
onError(WebSocket socket,
java.lang.Throwable error)
出错时
|
void |
onMessage(WebSocket socket,
java.nio.ByteBuffer binary)
收到消息时
|
void |
onMessage(WebSocket socket,
java.lang.String text)
收到消息时
|
void |
onOpen(WebSocket socket)
连接打开时(可以做个签权)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onPing, onPong
protected StompMessageSendingTemplate stompMessageSendingTemplate
public ToStompWebSocketListener()
public ToStompWebSocketListener(StompListener listener)
public void addListener(StompListener... listeners)
public java.lang.String getSubProtocols(@Nullable java.util.Collection<java.lang.String> requestProtocols)
getSubProtocols
在接口中 SubProtocolCapable
public void onOpen(WebSocket socket)
WebSocketListener
onOpen
在接口中 WebSocketListener
public void onMessage(WebSocket socket, java.lang.String text) throws java.io.IOException
WebSocketListener
onMessage
在接口中 WebSocketListener
java.io.IOException
public void onMessage(WebSocket socket, java.nio.ByteBuffer binary) throws java.io.IOException
WebSocketListener
onMessage
在接口中 WebSocketListener
java.io.IOException
public void onClose(WebSocket socket)
WebSocketListener
onClose
在接口中 WebSocketListener
public void onError(WebSocket socket, java.lang.Throwable error)
WebSocketListener
onError
在接口中 WebSocketListener