类 AbstractSubProtocolEvent

    • 构造器详细资料

      • AbstractSubProtocolEvent

        protected AbstractSubProtocolEvent​(Object source,
                                           Message<byte[]> message)
        Create a new AbstractSubProtocolEvent.
        参数:
        source - the component that published the event (never null)
        message - the incoming message
      • AbstractSubProtocolEvent

        protected AbstractSubProtocolEvent​(Object source,
                                           Message<byte[]> message,
                                           Principal user)
        Create a new AbstractSubProtocolEvent.
        参数:
        source - the component that published the event (never null)
        message - the incoming message
    • 方法详细资料

      • getMessage

        public Message<byte[]> getMessage()
        Return the Message associated with the event. Here is an example of obtaining information about the session id or any headers in the message:
         StompHeaderAccessor headers = StompHeaderAccessor.wrap(message);
         headers.getSessionId();
         headers.getSessionAttributes();
         headers.getPrincipal();
         
      • getUser

        public Principal getUser()
        Return the user for the session associated with the event.