All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.apexes.wsonrpc.server.WsonrpcSessions Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
/*
 * 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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy