当前位置: 首页>>代码示例>>Java>>正文


Java TAtomDsConfHandle类代码示例

本文整理汇总了Java中com.taobao.tddl.atom.config.TAtomDsConfHandle的典型用法代码示例。如果您正苦于以下问题:Java TAtomDsConfHandle类的具体用法?Java TAtomDsConfHandle怎么用?Java TAtomDsConfHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TAtomDsConfHandle类属于com.taobao.tddl.atom.config包,在下文中一共展示了TAtomDsConfHandle类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInit

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
public void doInit() throws TddlException {
    try {
        DruidDataSource localDruidDataSource = TAtomDsConfHandle.convertTAtomDsConf2DruidConf(confDO.getIp(),
            confDO,
            confDO.getDbName());
        boolean checkPram = TAtomDsConfHandle.checkLocalTxDataSourceDO(localDruidDataSource);
        if (checkPram) {
            localDruidDataSource.init();
            druidDataSource = localDruidDataSource;
        } else {
            throw new TddlException(ErrorCode.ERR_CONFIG, "atom config check failed");
        }
    } catch (Exception e) {
        throw new TddlNestableRuntimeException(e);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:17,代码来源:StaticTAtomDataSource.java

示例2: doInit

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
@Override
public void doInit() throws TddlException {
    LoggerInit.TDDL_DYNAMIC_CONFIG.info("TAtomDataSource start init");
    LoggerInit.TDDL_DYNAMIC_CONFIG.info("appName is: " + this.getAppName());
    LoggerInit.TDDL_DYNAMIC_CONFIG.info("unitName is: " + this.getUnitName());
    LoggerInit.TDDL_DYNAMIC_CONFIG.info("dbGroupKey is: " + this.getDbKey());

    String dbName = TAtomConstants.getDbNameStr(this.getUnitName(), this.getAppName(), this.getDbKey());
    synchronized (cacheConfHandleMap) {
        TAtomDsConfHandle cacheConfHandle = cacheConfHandleMap.get(dbName);
        if (null == cacheConfHandle) {
            // 初始化config的管理器
            this.dsConfHandle.init();
            cacheConfHandleMap.put(dbName, dsConfHandle);
            logger.info("create new TAtomDsConfHandle dbName : " + dbName);
        } else {
            dsConfHandle = cacheConfHandle;
            logger.info("use the cache TAtomDsConfHandle dbName : " + dbName);
        }
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:22,代码来源:TAtomDataSource.java

示例3: init

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
public void init() throws Exception {
    if (init) {
        throw new AtomAlreadyInitException("[AlreadyInit] double call Init !");
    }
    DruidDataSource localDruidDataSource = TAtomDsConfHandle.convertTAtomDsConf2DruidConf(confDO.getIp(),
        confDO,
        confDO.getDbName());
    boolean checkPram = TAtomDsConfHandle.checkLocalTxDataSourceDO(localDruidDataSource);
    if (checkPram) {
        localDruidDataSource.init();
        // druidDataSource =
        // TaobaoDataSourceFactory.createLocalTxDataSource(localDruidDataSource);
        druidDataSource = localDruidDataSource;
        init = true;
    } else {
        throw new Exception("Init DataSource Error Pleace Check!");
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:19,代码来源:StaticTAtomDataSource.java

示例4: cleanAllDataSource

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
/**
 * 清除掉所有数据源
 */
public static void cleanAllDataSource() {
    synchronized (cacheConfHandleMap) {
        for (TAtomDsConfHandle handles : cacheConfHandleMap.values()) {
            try {
                handles.destroyDataSource();
            } catch (Exception e) {
                logger.info("destory TAtomDsConfHandle failed!", e);
                continue;
            }
        }
        cacheConfHandleMap.clear();
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:17,代码来源:TAtomDataSource.java

示例5: init

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
public void init() throws Exception {
    String dbName = TAtomConstants.getDbNameStr(this.getUnitName(), this.getAppName(), this.getDbKey());
    synchronized (cacheConfHandleMap) {
        TAtomDsConfHandle cacheConfHandle = cacheConfHandleMap.get(dbName);
        if (null == cacheConfHandle) {
            // 初始化config的管理器
            this.dsConfHandle.init();
            cacheConfHandleMap.put(dbName, dsConfHandle);
            logger.info("create new TAtomDsConfHandle dbName : " + dbName);
        } else {
            dsConfHandle = cacheConfHandle;
            logger.info("use the cache TAtomDsConfHandle dbName : " + dbName);
        }
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:16,代码来源:TAtomDataSource.java

示例6: cleanAllDataSource

import com.taobao.tddl.atom.config.TAtomDsConfHandle; //导入依赖的package包/类
/**
 * 清除掉所有数据源
 */
public static void cleanAllDataSource() {
    synchronized (cacheConfHandleMap) {
        for (TAtomDsConfHandle handles : cacheConfHandleMap.values()) {
            try {
                handles.destroyDataSource();
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
        }
        cacheConfHandleMap.clear();
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:17,代码来源:TAtomDataSource.java


注:本文中的com.taobao.tddl.atom.config.TAtomDsConfHandle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。