Search in sources :

Example 1 with DefaultModuleDefinition

use of com.cloud.spring.module.model.impl.DefaultModuleDefinition in project cosmic by MissionCriticalCloud.

the class ClasspathModuleDefinitionLocator method discoverModules.

protected Map<String, ModuleDefinition> discoverModules(final String baseDir, final ResourcePatternResolver resolver) throws IOException {
    final Map<String, ModuleDefinition> result = new HashMap<>();
    for (final Resource r : resolver.getResources(ModuleLocationUtils.getModulesLocation(baseDir))) {
        final DefaultModuleDefinition def = new DefaultModuleDefinition(baseDir, r, resolver);
        def.init();
        if (def.isValid()) {
            result.put(def.getName(), def);
        }
    }
    return result;
}
Also used : DefaultModuleDefinition(com.cloud.spring.module.model.impl.DefaultModuleDefinition) ModuleDefinition(com.cloud.spring.module.model.ModuleDefinition) DefaultModuleDefinition(com.cloud.spring.module.model.impl.DefaultModuleDefinition) HashMap(java.util.HashMap) Resource(org.springframework.core.io.Resource)

Aggregations

ModuleDefinition (com.cloud.spring.module.model.ModuleDefinition)1 DefaultModuleDefinition (com.cloud.spring.module.model.impl.DefaultModuleDefinition)1 HashMap (java.util.HashMap)1 Resource (org.springframework.core.io.Resource)1