Java 类org.springframework.context.support.AbstractRefreshableConfigApplicationContext 实例源码

项目:onetwo    文件:SpringCmdRunner.java   
@Override
    protected void startAppContext(String[] args) {
//      SpringConfigApplicationContext context = new SpringConfigApplicationContext();
        AbstractRefreshableConfigApplicationContext context = createApplicationContext();
//      context.setConfigLocation("");
        Springs.initApplicationIfNotInitialized(context);
        initApplicationContext(context);
        context.refresh();
        this.afterInitApplicationContext(context);
    }
项目:carewebframework-core    文件:AppContextInitializer.java   
@Override
public void initialize(AbstractRefreshableConfigApplicationContext ctx) {
    ctx.setAllowBeanDefinitionOverriding(false);
    ConfigurableEnvironment env = ctx.getEnvironment();
    Set<String> aps = new LinkedHashSet<>();
    Collections.addAll(aps, env.getActiveProfiles());
    Collections.addAll(aps, testConfig ? Constants.PROFILES_TEST : Constants.PROFILES_PROD);
    env.getPropertySources().addLast(new LabelPropertySource());
    env.getPropertySources().addLast(new DomainPropertySource(ctx));
    env.setDefaultProfiles(Constants.PROFILE_ROOT_DEFAULT);
    ctx.setConfigLocations(Constants.DEFAULT_LOCATIONS);
    env.setActiveProfiles(aps.toArray(new String[aps.size()]));
}
项目:onetwo    文件:SpringCmdRunner.java   
protected void initApplicationContext(AbstractRefreshableConfigApplicationContext context){
}
项目:onetwo    文件:SpringCmdRunner.java   
protected void afterInitApplicationContext(AbstractRefreshableConfigApplicationContext context){
    Springs.getInstance().printBeanNames();
}
项目:onetwo    文件:SpringCmdRunner.java   
abstract protected AbstractRefreshableConfigApplicationContext createApplicationContext();