brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #340: ConfigMap refactor, respecting inheritanc...
Date Thu, 22 Sep 2016 11:45:05 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/340#discussion_r80023047
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
---
    @@ -107,4 +252,227 @@ public int size() {
         public boolean isEmpty() {
             return ownConfig.isEmpty();
         }
    +    
    +    protected ConfigInheritance getDefaultRuntimeInheritance() {
    +        return BasicConfigInheritance.OVERWRITE; 
    +    }
    +
    +    public <T> ReferenceWithError<ConfigValueAtContainer<TContainer,T>>
getConfigAndContainer(ConfigKey<T> key) {
    +        return getConfigImpl(key, false);
    +    }
    +
    +    protected abstract TContainer getParentOfContainer(TContainer container);
    +    
    +    @Nullable protected final <T> ConfigKey<T> getKeyAtContainer(TContainer
container, ConfigKey<T> queryKey) {
    +        if (container==null) return null;
    +        @SuppressWarnings("unchecked")
    +        ConfigKey<T> candidate = (ConfigKey<T>) getKeyAtContainerImpl(container,
queryKey);
    +        return candidate;
    +    }
    +    
    +    @Nullable protected abstract <T> ConfigKey<?> getKeyAtContainerImpl(@Nonnull
TContainer container, ConfigKey<T> queryKey);
    +
    +    protected Maybe<Object> getRawValueAtContainer(TContainer container, ConfigKey<?
extends Object> configKey) {
    +        return ((BrooklynObjectInternal)container).config().getInternalConfigMap().getConfigLocalRaw(configKey);
    +    }
    +    protected Maybe<Object> resolveRawValueFromContainer(TContainer container,
ConfigKey<?> key, Object value) {
    --- End diff --
    
    yes, javadoc quite useful to explain why this is here, it's messy but it has always been
so, at least now it's put into one place instead of multiple, and now explained.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message