Example usage for org.springframework.web.socket.sockjs.transport SockJsSessionFactory createSession

List of usage examples for org.springframework.web.socket.sockjs.transport SockJsSessionFactory createSession

Introduction

In this page you can find the example usage for org.springframework.web.socket.sockjs.transport SockJsSessionFactory createSession.

Prototype

SockJsSession createSession(String sessionId, WebSocketHandler handler, Map<String, Object> attributes);

Source Link

Document

Create a new SockJS session.

Usage

From source file:org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService.java

private SockJsSession createSockJsSession(String sessionId, SockJsSessionFactory sessionFactory,
        WebSocketHandler handler, Map<String, Object> attributes) {

    SockJsSession session = this.sessions.get(sessionId);
    if (session != null) {
        return session;
    }//from w ww  . ja va2  s  .  co m
    if (this.sessionCleanupTask == null) {
        scheduleSessionTask();
    }
    session = sessionFactory.createSession(sessionId, handler, attributes);
    this.sessions.put(sessionId, session);
    return session;
}