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

com.lmaye.cloud.starter.canal.context.CanalContext Maven / Gradle / Ivy

package com.lmaye.cloud.starter.canal.context;

import com.lmaye.cloud.starter.canal.model.CanalModel;

/**
 * --
 *
 * @author Lmay Zhou
 * @date 2021/3/22 11:27
 * @email [email protected]
 */
public class CanalContext {
    private static ThreadLocal threadLocal = new ThreadLocal<>();

    public static CanalModel getModel(){
       return threadLocal.get();
    }

    public static void setModel(CanalModel canalModel){
        threadLocal.set(canalModel);
    }

    public  static void removeModel(){
        threadLocal.remove();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy