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


Java CommandHandlerFactoryMyImp类代码示例

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


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

示例1: doInit

import com.taobao.tddl.repo.mysql.handler.CommandHandlerFactoryMyImp; //导入依赖的package包/类
@Override
public void doInit() {
    this.config = new RepositoryConfig();
    this.config.setProperty(RepositoryConfig.DEFAULT_TXN_ISOLATION, "READ_COMMITTED");
    this.config.setProperty(RepositoryConfig.IS_TRANSACTIONAL, "true");
    cfm = new CursorFactoryMyImpl();
    cef = new CommandHandlerFactoryMyImp();
    tables = CacheBuilder.newBuilder().build(new CacheLoader<String, LoadingCache<TableMeta, ITable>>() {

        @Override
        public LoadingCache<TableMeta, ITable> load(final String groupNode) throws Exception {
            return CacheBuilder.newBuilder().build(new CacheLoader<TableMeta, ITable>() {

                @Override
                public ITable load(TableMeta meta) throws Exception {
                    try {
                        DataSource ds = dsGetter.getDataSource(groupNode);
                        My_Table table = new My_Table(ds, meta, groupNode);
                        table.setSelect(false);
                        return table;
                    } catch (Exception ex) {
                        throw new TddlNestableRuntimeException(ex);
                    }
                }

            });
        }
    });

    executors = CacheBuilder.newBuilder().build(new CacheLoader<Group, IGroupExecutor>() {

        @Override
        public IGroupExecutor load(Group group) throws Exception {
            TGroupDataSource groupDS = new TGroupDataSource(group.getName(), group.getAppName());
            groupDS.setUnitName(group.getUnitName());
            groupDS.init();

            TddlGroupExecutor executor = new TddlGroupExecutor(getRepo());
            executor.setGroup(group);
            executor.setGroupDataSource(groupDS);
            executor.init();
            return executor;
        }
    });
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:46,代码来源:My_Repository.java

示例2: doInit

import com.taobao.tddl.repo.mysql.handler.CommandHandlerFactoryMyImp; //导入依赖的package包/类
@Override
public void doInit() {
    this.config = new RepositoryConfig();
    this.config.setProperty(RepositoryConfig.DEFAULT_TXN_ISOLATION, "READ_COMMITTED");
    this.config.setProperty(RepositoryConfig.IS_TRANSACTIONAL, "true");
    cfm = new CursorFactoryMyImpl();
    cef = new CommandHandlerFactoryMyImp();
    tables = CacheBuilder.newBuilder().build(new CacheLoader<String, LoadingCache<TableMeta, ITable>>() {

        @Override
        public LoadingCache<TableMeta, ITable> load(final String groupNode) throws Exception {
            return CacheBuilder.newBuilder().build(new CacheLoader<TableMeta, ITable>() {

                @Override
                public ITable load(TableMeta meta) throws Exception {
                    try {
                        DataSource ds = dsGetter.getDataSource(groupNode);
                        My_Table table = new My_Table(ds, meta, groupNode);
                        table.setSelect(false);
                        return table;
                    } catch (Exception ex) {
                        throw new TddlException(ExceptionErrorCodeUtils.Read_only, ex);
                    }
                }

            });
        }
    });

    executors = CacheBuilder.newBuilder().build(new CacheLoader<Group, IGroupExecutor>() {

        @Override
        public IGroupExecutor load(Group group) throws Exception {
            TGroupDataSource groupDS = new TGroupDataSource(group.getName(), group.getAppName());
            groupDS.init();

            TddlGroupExecutor executor = new TddlGroupExecutor(getRepo());
            executor.setGroup(group);
            executor.setRemotingExecutableObject(groupDS);
            return executor;
        }
    });
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:44,代码来源:My_Repository.java


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