类org.springframework.context.support.AbstractXmlApplicationContext源码实例Demo

下面列出了怎么用org.springframework.context.support.AbstractXmlApplicationContext的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: tddl5   文件: TddlRuleConfig.java
/**
 * 初始化某个版本的rule
 */
private synchronized boolean initVersionRule(String data, String version) {
    if (version == null) {
        version = NO_VERSION_NAME;
    }

    ApplicationContext ctx = null;
    try {
        // this rule may be wrong rule,don't throw it but log it,
        // and will not change the vtr!
        ctx = buildRuleByStr(version, data);
    } catch (Exception e) {
        throw new TddlNestableRuntimeException(e);
    }

    VirtualTableRoot tempvtr = (VirtualTableRoot) ctx.getBean(ROOT_BEAN_NAME);
    if (tempvtr != null) {
        // 直接覆盖
        vtrs.put(version, tempvtr);
        ruleStrs.put(version, data);
        AbstractXmlApplicationContext oldCtx = this.oldCtxs.get(version);
        // 销毁旧有容器
        if (oldCtx != null) {
            oldCtx.close();
        }
        // 记录一下当前ctx
        this.oldCtxs.remove(version);
        this.oldCtxs.put(version, (AbstractXmlApplicationContext) ctx);
    } else {
        logger.error("rule no vtabroot!!");
        return false;
    }
    return true;
}
 
源代码2 项目: tddl   文件: TddlRuleConfig.java
/**
 * 初始化某个版本的rule
 */
private synchronized boolean initVersionRule(String data, String version) {
    if (version == null) {
        version = NO_VERSION_NAME;
    }

    ApplicationContext ctx = null;
    try {
        // this rule may be wrong rule,don't throw it but log it,
        // and will not change the vtr!
        ctx = buildRuleByStr(version, data);
    } catch (Exception e) {
        logger.error("init rule error,rule str is:" + data, e);
        return false;
    }

    VirtualTableRoot tempvtr = (VirtualTableRoot) ctx.getBean(ROOT_BEAN_NAME);
    if (tempvtr != null) {
        // 直接覆盖
        vtrs.put(version, tempvtr);
        ruleStrs.put(version, data);
        AbstractXmlApplicationContext oldCtx = this.oldCtxs.get(version);
        // 销毁旧有容器
        if (oldCtx != null) {
            oldCtx.close();
        }
        // 记录一下当前ctx
        this.oldCtxs.remove(version);
        this.oldCtxs.put(version, (AbstractXmlApplicationContext) ctx);
    } else {
        logger.error("rule no vtabroot!!");
        return false;
    }
    return true;
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/routingslip-header.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc-eager.xml");
}
 
源代码5 项目: camelinaction2   文件: InventorySpringXMLTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route-xml.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-timeout-threadpool.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route-defer-xml.xml");
}
 
源代码8 项目: camelinaction   文件: SpringRiderTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext(new String[]{"camelinaction/rider-spring-prod.xml", "camelinaction/rider-spring-test.xml"});
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route-java.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc-hawtdb.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc-close.xml");
}
 
源代码12 项目: camelinaction2   文件: SpringSplitterABCTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/splitter-abc.xml");
}
 
源代码13 项目: camelinaction   文件: InventoryJavaDSLTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route-java.xml");
}
 
源代码14 项目: camelinaction2   文件: SpringAggregateABCTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc.xml");
}
 
源代码15 项目: camelinaction   文件: OrderTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route.xml");
}
 
源代码16 项目: camelinaction2   文件: SpringWireTapTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/wiretap.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/failover-loadbalancer.xml");
}
 
源代码18 项目: camelinaction2   文件: SpringEarlyReplyTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/earlyreply-context.xml");
}
 
源代码19 项目: camelinaction2   文件: MulticastParallelTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/route-parallel.xml");
}
 
源代码20 项目: camelinaction2   文件: SpringBigFileSedaTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/BigFileSedaTest.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/random-loadbalancer.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/BigFileFixedThreadPoolTest.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc-leveldb.xml");
}
 
源代码24 项目: camelinaction   文件: SpringLoadBalancerTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/loadbalancer.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/CustomThreadPoolProfileTest.xml");
}
 
源代码26 项目: camelinaction2   文件: SpringAggregateXMLTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-xml.xml");
}
 
源代码27 项目: camelinaction   文件: GracefulShutdownTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/camel-route-java.xml");
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/aggregate-abc-group.xml");
}
 
源代码29 项目: camelinaction2   文件: SpringSecurityTest.java
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/spring-security.xml"});
}
 
@Override
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("META-INF/spring/failover-roundrobin-loadbalancer.xml");
}
 
 类方法
 同包方法