Examples of SessionConnectEvent


Examples of org.springframework.session.web.socket.events.SessionConnectEvent

    public void onApplicationEvent(ApplicationEvent event) {
        if(event instanceof SessionDestroyedEvent) {
            SessionDestroyedEvent e = (SessionDestroyedEvent) event;
            closeWsSessions(e.getSessionId());
        } else if(event instanceof SessionConnectEvent) {
            SessionConnectEvent e = (SessionConnectEvent) event;
            afterConnectionEstablished(e.getWebSocketSession());
        } else if(event instanceof SessionDisconnectEvent) {
            SessionDisconnectEvent e = (SessionDisconnectEvent) event;
            Map<String, Object> sessionAttributes = SimpMessageHeaderAccessor.getSessionAttributes(e.getMessage().getHeaders());
            String httpSessionId =  sessionAttributes == null ? null : SessionRepositoryMessageInterceptor.getSessionId(sessionAttributes);
            afterConnectionClosed(httpSessionId, e.getSessionId());
        }
    }
View Full Code Here

Examples of org.springframework.session.web.socket.events.SessionConnectEvent

        @Override
        public void afterConnectionEstablished(WebSocketSession wsSession)
                throws Exception {
            super.afterConnectionEstablished(wsSession);

            publishEvent(new SessionConnectEvent(this,wsSession));
        }
View Full Code Here

Examples of org.springframework.session.web.socket.events.SessionConnectEvent

        Map<String,Object> headers = new HashMap<>();
        headers.put(SimpMessageHeaderAccessor.SESSION_ATTRIBUTES, attributes);
        when(message.getHeaders()).thenReturn(new MessageHeaders(headers));

        listener = new WebSocketRegistryListener();
        connect = new SessionConnectEvent(listener,wsSession);
        connect2 = new SessionConnectEvent(listener,wsSession2);
        disconnect = new SessionDisconnectEvent(listener, message, wsSession.getId(), CloseStatus.NORMAL);
        destroyed = new SessionDestroyedEvent(listener, sessionId);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.