use of com.haulmont.cuba.core.sys.events.AppContextInitializedEvent in project cuba by cuba-platform.
the class AbstractAppContextLoader method initAppContext.
protected void initAppContext() {
String configProperty = AppContext.getProperty(SPRING_CONTEXT_CONFIG);
if (StringUtils.isBlank(configProperty)) {
throw new IllegalStateException("Missing " + SPRING_CONTEXT_CONFIG + " application property");
}
StrTokenizer tokenizer = new StrTokenizer(configProperty);
String[] locations = tokenizer.getTokenArray();
replaceLocationsFromConf(locations);
ApplicationContext appContext = createApplicationContext(locations);
AppContext.Internals.setApplicationContext(appContext);
Events events = AppBeans.get(Events.NAME);
events.publish(new AppContextInitializedEvent(appContext));
log.debug("AppContext initialized");
}
use of com.haulmont.cuba.core.sys.events.AppContextInitializedEvent in project cuba by cuba-platform.
the class TestContainer method initAppContext.
protected void initAppContext() {
EclipseLinkCustomizer.initTransientCompatibleAnnotations();
String configProperty = AppContext.getProperty(AbstractAppContextLoader.SPRING_CONTEXT_CONFIG);
StrTokenizer tokenizer = new StrTokenizer(configProperty);
List<String> locations = tokenizer.getTokenList();
locations.add(getSpringConfig());
springAppContext = new CubaCoreApplicationContext(locations.toArray(new String[locations.size()]));
AppContext.Internals.setApplicationContext(springAppContext);
Events events = AppBeans.get(Events.NAME);
events.publish(new AppContextInitializedEvent(springAppContext));
}
Aggregations