Search in sources :

Example 1 with DefaultModuleDefinition

use of org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinition in project cloudstack by apache.

the class ClasspathModuleDefinitionLocator method discoverModules.

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

Aggregations

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