Github user aledsage commented on a diff in the pull request:
    --- Diff: 
    @@ -20,65 +20,212 @@
     import java.util.Collections;
     import java.util.LinkedHashMap;
    +import java.util.List;
     import java.util.Map;
    +import java.util.Set;
     import java.util.concurrent.Future;
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +import org.apache.brooklyn.api.mgmt.ExecutionContext;
    +import org.apache.brooklyn.api.objs.BrooklynObject;
    +import org.apache.brooklyn.config.ConfigInheritance;
    +import org.apache.brooklyn.config.ConfigInheritances;
     import org.apache.brooklyn.config.ConfigKey;
    -import org.apache.brooklyn.config.ConfigMap;
     import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
    +import org.apache.brooklyn.config.ConfigMap.ConfigMapWithInheritance;
    +import org.apache.brooklyn.config.ConfigValueAtContainer;
    +import org.apache.brooklyn.core.config.BasicConfigInheritance;
    +import org.apache.brooklyn.core.config.ConfigKeys;
    +import org.apache.brooklyn.core.config.ConfigKeys.InheritanceContext;
    +import org.apache.brooklyn.core.config.Sanitizer;
     import org.apache.brooklyn.core.config.StructuredConfigKey;
    +import org.apache.brooklyn.core.objs.BrooklynObjectInternal;
    +import org.apache.brooklyn.util.collections.MutableList;
    +import org.apache.brooklyn.util.collections.MutableMap;
    +import org.apache.brooklyn.util.collections.MutableSet;
    +import org.apache.brooklyn.util.core.config.ConfigBag;
     import org.apache.brooklyn.util.core.flags.TypeCoercions;
    +import org.apache.brooklyn.util.core.internal.ConfigKeySelfExtracting;
     import org.apache.brooklyn.util.core.task.DeferredSupplier;
    +import org.apache.brooklyn.util.exceptions.ReferenceWithError;
    +import org.apache.brooklyn.util.guava.Maybe;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
    -public abstract class AbstractConfigMapImpl implements ConfigMap {
    +public abstract class AbstractConfigMapImpl<TContainer extends 
BrooklynObject> implements ConfigMapWithInheritance<TContainer> {
    +    /*
    +     * Changed Sept 2016 so that keys can determine inheritance strategy 
at every level in the hierarchy,
    +     * and signifcantly refactored to share code among subclasses, adding 
Location as a subclass.
    +     */
         private static final Logger LOG = 
    -    protected final ConfigMapViewWithStringKeys mapViewWithStringKeys = 
new ConfigMapViewWithStringKeys(this);
    +    @SuppressWarnings("deprecation")
    +    protected final transient 
mapViewWithStringKeys = new 
    +    protected TContainer bo;
          * Map of configuration information that is defined at start-up time 
for the entity. These
          * configuration parameters are shared and made accessible to the 
"children" of this
          * entity.
    -    protected Map<ConfigKey<?>,Object> ownConfig = 
Collections.synchronizedMap(new LinkedHashMap<ConfigKey<?>, Object>());
    +    protected final Map<ConfigKey<?>,Object> ownConfig;
    +    protected AbstractConfigMapImpl(TContainer bo) {
    +        // Not using ConcurrentMap, because want to (continue to) allow 
null values.
    +        // Could use ConcurrentMapAcceptingNullVals (with the associated 
performance hit on entrySet() etc).
    +        this(bo, Collections.synchronizedMap(new 
LinkedHashMap<ConfigKey<?>, Object>()));
    +    }
    +    protected AbstractConfigMapImpl(TContainer bo, Map<ConfigKey<?>, 
Object> storage) {
    + = bo;
    +        this.ownConfig = storage;
    +    }
    +    public TContainer getContainer() {
    +        return bo;
    +    }
    +    protected final BrooklynObjectInternal getBrooklynObject() {
    +        return (BrooklynObjectInternal)bo;
    +    }
         public <T> T getConfig(ConfigKey<T> key) {
    -        return getConfig(key, null);
    +        return getConfigImpl(key, false).getWithoutError().get();
         public <T> T getConfig(HasConfigKey<T> key) {
    -        return getConfig(key.getConfigKey(), null);
    +        return getConfigImpl(key.getConfigKey(), 
    -    public <T> T getConfig(HasConfigKey<T> key, T defaultValue) {
    -        return getConfig(key.getConfigKey(), defaultValue);
    +    @Override
    +    public Maybe<Object> getConfigLocalRaw(ConfigKey<?> key) {
    +        return getConfigRaw(key, false);
    +    }
    +    protected abstract ExecutionContext getExecutionContext(BrooklynObject 
    +    protected abstract void postLocalEvaluate(ConfigKey<?> key, 
BrooklynObject bo, Maybe<?> rawValue, Maybe<?> resolvedValue);
    --- End diff --
    @ahgittin It wasn't obvious to me because nothing calls this method. I see 
from `EntityConfigMap.postLocalEvaluate` what the purpose is.
    Is there a missing call to this method?

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

Reply via email to