}
protected ApplicationContext getDefaultsContext() {
URL config = DefaultModuleDefinitionSet.class.getResource(DEFAULT_CONFIG_XML);
ResourceApplicationContext context = new ResourceApplicationContext(new UrlResource(config));
context.setApplicationName("/defaults");
context.refresh();
@SuppressWarnings("unchecked")
final List<Resource> resources = (List<Resource>) context.getBean(DEFAULT_CONFIG_RESOURCES);
withModule(new WithModule() {
public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
for ( Resource defaults : def.getConfigLocations() ) {
resources.add(defaults);
}
}
});
configProperties = (Properties) context.getBean(DEFAULT_CONFIG_PROPERTIES);
for ( Resource resource : resources ) {
load(resource, configProperties);
}
for ( Resource resource : (Resource[])context.getBean(MODULE_PROPERITES) ) {
load(resource, configProperties);
}
parseExcludes();