List of usage examples for org.springframework.beans.factory.xml XmlBeanDefinitionReader loadBeanDefinitions
public int loadBeanDefinitions(InputSource inputSource, @Nullable String resourceDescription) throws BeanDefinitionStoreException
From source file:com.obergner.hzserver.Main.java
void start() throws Exception { enableHangupSupport();/*from www . j ava 2 s. c om*/ this.serverInfo.logBootStart(); final GenericApplicationContext ctx = new GenericApplicationContext(); final XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx); xmlReader.loadBeanDefinitions("classpath:META-INF/spring/hz-server-main-context.xml", "classpath*:META-INF/spring/hz-cache-context.xml"); ctx.registerShutdownHook(); ctx.addApplicationListener(new ApplicationListener<ContextRefreshedEvent>() { @Override public void onApplicationEvent(final ContextRefreshedEvent event) { Main.this.serverInfo.logBootCompleted(); } }); ctx.addApplicationListener(new ApplicationListener<ContextStoppedEvent>() { @Override public void onApplicationEvent(final ContextStoppedEvent event) { Main.this.serverInfo.logShutdownCompleted(); } }); ctx.refresh(); }