protected void populateConfiguration(Date date, Configurable configurable) { if (_configured.contains(configurable)) return; s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName()); for (ConfigKey<?> key : configurable.getConfigKeys()) { Pair<String, ConfigKey<?>> previous = _allKeys.get(key.key()); if (previous != null && !previous.first().equals(configurable.getConfigComponentName())) { throw new CloudRuntimeException("Configurable " + configurable.getConfigComponentName() + " is adding a key that has been added before by " + previous.first() + ": " + key.toString()); } _allKeys.put(key.key(), new Pair<String, ConfigKey<?>>(configurable.getConfigComponentName(), key)); createOrupdateConfigObject(date, configurable.getConfigComponentName(), key, null); if ((key.scope() != null) && (key.scope() != ConfigKey.Scope.Global)) { Set<ConfigKey<?>> currentConfigs = _scopeLevelConfigsMap.get(key.scope()); currentConfigs.add(key); } } _configured.add(configurable); }