类 SessionDisconnectEvent
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.web.socket.messaging.AbstractSubProtocolEvent
- org.springframework.web.socket.messaging.SessionDisconnectEvent
- 所有已实现的接口:
Serializable
public class SessionDisconnectEvent extends AbstractSubProtocolEvent
Event raised when the session of a WebSocket client using a Simple Messaging Protocol (e.g. STOMP) as the WebSocket sub-protocol is closed.Note that this event may be raised more than once for a single session and therefore event consumers should be idempotent and ignore a duplicate event.
- 从以下版本开始:
- 4.0.3
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
字段概要
从类继承的字段 java.util.EventObject
source
构造器概要
构造器 构造器 说明 SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus)
Create a new SessionDisconnectEvent.SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus, Principal user)
Create a new SessionDisconnectEvent.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 CloseStatus
getCloseStatus()
Return the status with which the session was closed.String
getSessionId()
Return the session id.String
toString()
从类继承的方法 org.springframework.web.socket.messaging.AbstractSubProtocolEvent
getMessage, getUser
从类继承的方法 org.springframework.context.ApplicationEvent
getTimestamp
从类继承的方法 java.util.EventObject
getSource
构造器详细资料
SessionDisconnectEvent
public SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus)
Create a new SessionDisconnectEvent.- 参数:
source
- the component that published the event (nevernull
)message
- the messagesessionId
- the disconnect messagecloseStatus
- the status object
SessionDisconnectEvent
public SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, CloseStatus closeStatus, Principal user)
Create a new SessionDisconnectEvent.- 参数:
source
- the component that published the event (nevernull
)message
- the messagesessionId
- the disconnect messagecloseStatus
- the status objectuser
- the current session user
方法详细资料
getSessionId
public String getSessionId()
Return the session id.
getCloseStatus
public CloseStatus getCloseStatus()
Return the status with which the session was closed.
toString
public String toString()
- 覆盖:
toString
在类中AbstractSubProtocolEvent