Package org.springframework.session.events

Examples of org.springframework.session.events.SessionDestroyedEvent


    private final ConcurrentHashMap<String,Map<String,WebSocketSession>> httpSessionIdToWsSessions = new ConcurrentHashMap<String,Map<String,WebSocketSession>>();

    @Override
    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


        String channel = new String(message.getChannel());
        int beginIndex = channel.lastIndexOf(":") + 1;
        int endIndex = channel.length();
        String sessionId = channel.substring(beginIndex, endIndex);

        publishEvent(new SessionDestroyedEvent(this, sessionId));
    }
View Full Code Here

        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

Related Classes of org.springframework.session.events.SessionDestroyedEvent

Copyright © 2018 www.massapicom. 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.