org.conductor.bootstrap.Bootstrap Maven / Gradle / Ivy
package org.conductor.bootstrap;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.conductor.component.types.IComponent;
import org.conductor.database.Database;
import org.conductor.integration.factories.ComponentFactory;
public class Bootstrap implements IComponentGroupBootstrap {
private static Logger log = LogManager.getLogger(Bootstrap.class.getName());
public Map start(Database database, Map componentGroupOptions, Map> componentsOptions) throws InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
ComponentFactory componentFactory = new ComponentFactory();
List componentNames = componentFactory.getComponentNames();
Map components = new HashMap();
log.info("Found {} components.", componentNames.size());
for(String componentName : componentNames) {
log.info("Creating component '{}'.", componentName);
Map componentOption = componentsOptions.get(componentName);
IComponent component = componentFactory.createComponent(componentName, database, componentOption);
components.put(componentName, component);
}
return components;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy