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


Java StringXmlApplicationContext类代码示例

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


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

示例1: parseSequence

import com.taobao.tddl.rule.utils.StringXmlApplicationContext; //导入依赖的package包/类
public void parseSequence(String data) {
    StringXmlApplicationContext context = new StringXmlApplicationContext(data);
    String[] seqNames = context.getBeanNamesForType(GroupSequence.class);

    sequences.clear();
    for (String seqName : seqNames) {
        GroupSequence seq = (GroupSequence) context.getBean(seqName);
        sequences.put(seqName, seq);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:11,代码来源:SequenceManager.java

示例2: buildRuleByStr

import com.taobao.tddl.rule.utils.StringXmlApplicationContext; //导入依赖的package包/类
/**
 * 基于string字符流创建rule的spring容器
 * 
 * @param data
 * @return
 */
private ApplicationContext buildRuleByStr(String version, String data) {
    if (compatibleOldRule) {
        data = RuleCompatibleHelper.compatibleRule(data);
    }
    ApplicationContext applicationContext = new StringXmlApplicationContext(data, outerClassLoader);
    ruleStrs.put(version, data); // 记录一下
    return applicationContext;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:15,代码来源:TddlRuleConfig.java

示例3: testCompatible_interact

import com.taobao.tddl.rule.utils.StringXmlApplicationContext; //导入依赖的package包/类
@Test
public void testCompatible_interact() {
    try {
        Resource resource = new PathMatchingResourcePatternResolver().getResource("classpath:compatible/interact-spring-context.xml");
        String ruleStr = StringUtils.join(IOUtils.readLines(resource.getInputStream()), SystemUtils.LINE_SEPARATOR);
        ApplicationContext context = new StringXmlApplicationContext(RuleCompatibleHelper.compatibleRule(ruleStr));
        VirtualTableRoot vtr1 = (VirtualTableRoot) context.getBean("vtabroot");
        Assert.assertNotNull(vtr1);
    } catch (IOException e) {
        Assert.fail(ExceptionUtils.getFullStackTrace(e));
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:13,代码来源:RuleCompatibleHelperTest.java

示例4: testCompatible_le

import com.taobao.tddl.rule.utils.StringXmlApplicationContext; //导入依赖的package包/类
@Test
public void testCompatible_le() {
    try {
        Resource resource = new PathMatchingResourcePatternResolver().getResource("classpath:compatible/le-spring-context.xml");
        String ruleStr = StringUtils.join(IOUtils.readLines(resource.getInputStream()), SystemUtils.LINE_SEPARATOR);
        ApplicationContext context = new StringXmlApplicationContext(RuleCompatibleHelper.compatibleRule(ruleStr));
        VirtualTableRoot vtr1 = (VirtualTableRoot) context.getBean("vtabroot");
        Assert.assertNotNull(vtr1);
    } catch (IOException e) {
        Assert.fail(ExceptionUtils.getFullStackTrace(e));
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:13,代码来源:RuleCompatibleHelperTest.java


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