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

org.jeecgframework.minidao.datasource.DataSourceContextHolder Maven / Gradle / Ivy

The newest version!
package org.jeecgframework.minidao.datasource;

/**
 * 类名:DataSourceContextHolder.java 功能:获得和设置上下文环境的类,主要负责改变上下文数据源的名称
 * DataSourceContextHolder
 * 
 * @description:DataSourceContextHolder
 * @author 张代浩
 * @mail [email protected]
 * @category www.jeecg.com
 * @date 20130817
 * @version V1.0
 */
public class DataSourceContextHolder {

	private static final ThreadLocal contextHolder = new ThreadLocal();

	public static void clearDataSourceType() {
		contextHolder.remove();
	}

	public static DataSourceType getDataSourceType() {
		return (DataSourceType) contextHolder.get();
	}

	public static void setDataSourceType(DataSourceType dataSourceType) {
		contextHolder.set(dataSourceType);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy