net.apexes.wsonrpc.server.WsonrpcSessions Maven / Gradle / Ivy
/*
* Copyright (C) 2015, apexes.net. All rights reserved.
*
* http://www.apexes.net
*
*/
package net.apexes.wsonrpc.server;
import net.apexes.wsonrpc.core.WebSocketSession;
/**
*
* @author HeDYn
*
*/
public final class WsonrpcSessions {
private WsonrpcSessions() {}
private static final ThreadLocal sessions = new ThreadLocal<>();
static void begin(WebSocketSession session) {
sessions.set(session);
}
static void end() {
sessions.remove();
}
public static WebSocketSession get() {
return sessions.get();
}
}