类 StompSubProtocolErrorHandler
- java.lang.Object
- org.springframework.web.socket.messaging.StompSubProtocolErrorHandler
- 所有已实现的接口:
SubProtocolErrorHandler<byte[]>
public class StompSubProtocolErrorHandler extends Object implements SubProtocolErrorHandler<byte[]>
ASubProtocolErrorHandler
for use with STOMP.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 StompSubProtocolErrorHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Message<byte[]>
handleClientMessageProcessingError(Message<byte[]> clientMessage, Throwable ex)
Handle errors thrown while processing client messages providing an opportunity to prepare the error message or to prevent one from being sent.Message<byte[]>
handleErrorMessageToClient(Message<byte[]> errorMessage)
Handle errors sent from the server side to clients, e.g. errors from the"broke relay"
because connectivity failed or the external broker sent an error message, etc.protected Message<byte[]>
handleInternal(StompHeaderAccessor errorHeaderAccessor, byte[] errorPayload, Throwable cause, StompHeaderAccessor clientHeaderAccessor)
构造器详细资料
StompSubProtocolErrorHandler
public StompSubProtocolErrorHandler()
方法详细资料
handleClientMessageProcessingError
public Message<byte[]> handleClientMessageProcessingError(Message<byte[]> clientMessage, Throwable ex)
从接口复制的说明:SubProtocolErrorHandler
Handle errors thrown while processing client messages providing an opportunity to prepare the error message or to prevent one from being sent.Note that the STOMP protocol requires a server to close the connection after sending an ERROR frame. To prevent an ERROR frame from being sent, a handler could return
null
and send a notification message through the broker instead, e.g. via a user destination.- 指定者:
handleClientMessageProcessingError
在接口中SubProtocolErrorHandler<byte[]>
- 参数:
clientMessage
- the client message related to the error, possiblynull
if error occurred while parsing a WebSocket messageex
- the cause for the error, nevernull
- 返回:
- the error message to send to the client, or
null
in which case no message will be sent.
handleErrorMessageToClient
public Message<byte[]> handleErrorMessageToClient(Message<byte[]> errorMessage)
从接口复制的说明:SubProtocolErrorHandler
Handle errors sent from the server side to clients, e.g. errors from the"broke relay"
because connectivity failed or the external broker sent an error message, etc.- 指定者:
handleErrorMessageToClient
在接口中SubProtocolErrorHandler<byte[]>
- 参数:
errorMessage
- the error message, nevernull
- 返回:
- the error message to send to the client, or
null
in which case no message will be sent.
handleInternal
protected Message<byte[]> handleInternal(StompHeaderAccessor errorHeaderAccessor, byte[] errorPayload, Throwable cause, StompHeaderAccessor clientHeaderAccessor)