private static SockJsSession getSession(final SockJsServiceFactory factory, final String sessionId) { SockJsSession session = sessions.get(sessionId); if (session == null) { final SockJsSession newSession = new SockJsSession(sessionId, factory.create()); session = sessions.putIfAbsent(sessionId, newSession); if (session == null) { session = newSession; } logger.debug("Created new session [{}]", sessionId); } else { logger.debug("Using existing session [{}]", sessionId); } return session; }
private static SockJsSession getSession(final SockJsServiceFactory factory, final String sessionId) { SockJsSession session = sessions.get(sessionId); if (session == null) { final SockJsSession newSession = new SockJsSession(sessionId, factory.create()); session = sessions.putIfAbsent(sessionId, newSession); if (session == null) { session = newSession; } logger.debug("Created new session [{}]", sessionId); } else { logger.debug("Using existing session [{}]", sessionId); } return session; }
case WEBSOCKET: addTransportHandler(new WebSocketTransport(factory.config()), ctx); addSessionHandler(new WebSocketSessionState(new SockJsSession(randomUUID().toString(), factory.create())), ctx); break;
case WEBSOCKET: addTransportHandler(new WebSocketTransport(factory.config()), ctx); addSessionHandler(new WebSocketSessionState(new SockJsSession(randomUUID().toString(), factory.create())), ctx); break;