// Path: uncode-dal/src/main/java/cn/uncode/dal/datasource/DBContextHolder.java
// public class DBContextHolder {
// 	
// 	public static final String WRITE = "write";
// 	public static final String READ = "read";
// 	public static final String STANDBY = "standby";
// 	public static final String REPORT = "report";
// 	public static final String TRANSACTION = "transaction";
// 	
// 	private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<String>();
// 
// 	public static void swithToWrite() {
// 		if(!TRANSACTION.equals(CONTEXT_HOLDER.get())){
// 			CONTEXT_HOLDER.set(WRITE);
// 		}
// 	}
// 	
// 	public static void swithToRead() {
// 		if(!TRANSACTION.equals(CONTEXT_HOLDER.get())){
// 			CONTEXT_HOLDER.set(READ);
// 		}
// 	}
// 	
// 	public static void swithToReport() {
// 		CONTEXT_HOLDER.set(REPORT);
// 	}
// 	
// 	public static void swithTotransaction() {
// 		CONTEXT_HOLDER.set(TRANSACTION);
// 	}
// 	
// 	public static void swithTo(String dbType) {
// 		CONTEXT_HOLDER.set(dbType);
// 	}
// 
// 	public static String getCurrentDataSourceKey() {
// 		return CONTEXT_HOLDER.get();
// 	}
// 
// 	public static void clear() {
// 		CONTEXT_HOLDER.remove();
// 	}
// 	
// }


import cn.uncode.dal.datasource.DBContextHolder;
package cn.uncode.dal.router;


public class DefaultMasterSlaveRouter implements MasterSlaveRouter {

	@Override
	public void routeToMaster() {
// Path: uncode-dal/src/main/java/cn/uncode/dal/datasource/DBContextHolder.java
// public class DBContextHolder {
// 	
// 	public static final String WRITE = "write";
// 	public static final String READ = "read";
// 	public static final String STANDBY = "standby";
// 	public static final String REPORT = "report";
// 	public static final String TRANSACTION = "transaction";
// 	
// 	private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<String>();
// 
// 	public static void swithToWrite() {
// 		if(!TRANSACTION.equals(CONTEXT_HOLDER.get())){
// 			CONTEXT_HOLDER.set(WRITE);
// 		}
// 	}
// 	
// 	public static void swithToRead() {
// 		if(!TRANSACTION.equals(CONTEXT_HOLDER.get())){
// 			CONTEXT_HOLDER.set(READ);
// 		}
// 	}
// 	
// 	public static void swithToReport() {
// 		CONTEXT_HOLDER.set(REPORT);
// 	}
// 	
// 	public static void swithTotransaction() {
// 		CONTEXT_HOLDER.set(TRANSACTION);
// 	}
// 	
// 	public static void swithTo(String dbType) {
// 		CONTEXT_HOLDER.set(dbType);
// 	}
// 
// 	public static String getCurrentDataSourceKey() {
// 		return CONTEXT_HOLDER.get();
// 	}
// 
// 	public static void clear() {
// 		CONTEXT_HOLDER.remove();
// 	}
// 	
// }


// Path: uncode-dal/src/main/java/cn/uncode/dal/router/DefaultMasterSlaveRouter.java
import cn.uncode.dal.datasource.DBContextHolder;

package cn.uncode.dal.router;


public class DefaultMasterSlaveRouter implements MasterSlaveRouter {

	@Override
	public void routeToMaster() {
		DBContextHolder.swithToWrite();