package cn.com.poc.expose.websocket.holder;


import cn.com.poc.expose.websocket.handler.AbstractWsHandler;

/**
 * @author alex.yao
 * @date 2024/3/19 22:50
 */
public class WSHandlerHolder {

    private final static ThreadLocal<AbstractWsHandler> WS_HANDLER_HOLDER = new ThreadLocal<>();

    public static AbstractWsHandler get(){
        return WS_HANDLER_HOLDER.get();
    }

    public static void set(AbstractWsHandler abstractWsHandler){
        WS_HANDLER_HOLDER.set(abstractWsHandler);
    }

    public static void clear(){
        WS_HANDLER_HOLDER.remove();
    }

}
