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:26:37 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/340#discussion_r80020924
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
---
    @@ -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.ConfigInheritances.BasicConfigValueAtContainer;
     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.entity.internal.ConfigMapViewWithStringKeys;
    +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 {
    +import com.google.common.base.Function;
    +import com.google.common.base.Predicate;
    +import com.google.common.collect.Iterables;
    +
    +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 = LoggerFactory.getLogger(AbstractConfigMapImpl.class);
         
    -    protected final ConfigMapViewWithStringKeys mapViewWithStringKeys = new ConfigMapViewWithStringKeys(this);
    +    @SuppressWarnings("deprecation")
    +    protected final transient org.apache.brooklyn.core.entity.internal.ConfigMapViewWithStringKeys
mapViewWithStringKeys = new org.apache.brooklyn.core.entity.internal.ConfigMapViewWithStringKeys(this);
    --- End diff --
    
    it's deprecated (i've added an annotation for this) ... just in case the MapImpl was written
anywhere i think marking transient for one release is a good practice


---
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