/** * Retrieves the list of configured beans */ public Map<String, Collection<?>> getBeans () { if (null != beans) { // already configured return beans; } configure(); beans = new HashMap<>(); for (String classname : beanTypes) { Class<?> clazz; try { clazz = Class.forName("org.powertac.evcustomer.beans." + classname); Collection<?> list = serverConfiguration.configureInstances(clazz); beans.put(classname, list); log.info("Loaded " + list.size() + " instances of " + classname); } catch (ClassNotFoundException e) { log.error("Cannot find class " + classname); } } return beans; }
/** * Retrieves the list of configured beans, given a package prefix and a list * of classnames in that package. The final argument should be an instance in * the module where the bean classes are found. This is where the classloader * comes from. */ public Map<String, Collection<?>> getBeans () { if (null != beans) // already configured return beans; configure(); beans = new HashMap<String, Collection<?>>(); for (String classname : beanTypes) { Class<?> clazz; try { clazz = Class.forName("org.powertac.customer.model." + classname); Collection<?> list = serverConfiguration.configureInstances(clazz); beans.put(classname, list); log.info("Loaded " + list.size() + " instances of " + classname); } catch (ClassNotFoundException e) { log.error("Cannot find class " + classname); } } return beans; }
try { clazz = Class.forName("org.powertac.factoredcustomer." + classname); Collection<?> list = serverConfiguration.configureInstances(clazz); if (list == null) { structures.put(classname, new HashMap<>());
AbstractCustomer modelEx = modelIterator.next(); Collection<?> instances = serverConfig.configureInstances(modelEx.getClass()); for (Object modelObj: instances) { AbstractCustomer model = (AbstractCustomer) modelObj;
Collection<?> gencoColl = serverConfig.configureInstances(Genco.class); if (null != gencoColl) { for (Object gencoObj: gencoColl) {