brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] brooklyn-server pull request #340: ConfigMap refactor, respecting inheritanc...
Date Thu, 22 Sep 2016 07:30:00 GMT
Github user aledsage commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/brooklyn/core/config/
    @@ -0,0 +1,166 @@
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.brooklyn.core.config;
    +import java.util.Map;
    +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.ConfigValueAtContainer;
    +import org.apache.brooklyn.util.collections.CollectionMerger;
    +import org.apache.brooklyn.util.exceptions.ReferenceWithError;
    +import org.apache.brooklyn.util.guava.Maybe;
    +public class BasicConfigInheritance implements ConfigInheritance {
    +    private static final long serialVersionUID = -5916548049057961051L;
    +    public static final String CONFLICT_RESOLUTION_STRATEGY_DEEP_MERGE = "deep_merge";
    +    public static final String CONFLICT_RESOLUTION_STRATEGY_OVERWRITE = "overwrite";
    +    /** Indicates that a config key value should not be passed down from a container
where it is defined.
    +     * Unlike {@link #NEVER_INHERITED} these values can be passed down if set as anonymous
keys at a container
    +     * (ie the container does not expect it) to a container which does expect it, but
it will not be passed down further. 
    +     * If the inheritor also defines a value the parent's value is ignored irrespective

    +     * (as in {@link #OVERWRITE}; see {@link #NOT_REINHERITED_ELSE_DEEP_MERGE} if merging
is desired). */
    +    public static BasicConfigInheritance NOT_REINHERITED = new BasicConfigInheritance(false,CONFLICT_RESOLUTION_STRATEGY_OVERWRITE,false);
    +    /** As {@link #NOT_REINHERITED} but in cases where a value is inherited because a
parent did not recognize it,
    +     * if the inheritor also defines a value the two values should be merged. */
    +    public static BasicConfigInheritance NOT_REINHERITED_ELSE_DEEP_MERGE = new BasicConfigInheritance(false,CONFLICT_RESOLUTION_STRATEGY_DEEP_MERGE,false);
    +    /** Indicates that a key's value should never be inherited, even if defined on a
container that does not know the key.
    +     * Most usages will prefer {@link #NOT_REINHERITED}. */
    +    public static BasicConfigInheritance NEVER_INHERITED = new BasicConfigInheritance(false,CONFLICT_RESOLUTION_STRATEGY_OVERWRITE,true);
    +    /** Indicates that if a key has a value at both an ancestor and a descendant, the
descendant and his descendants
    +     * will prefer the value at the descendant. */
    +    public static BasicConfigInheritance OVERWRITE = new BasicConfigInheritance(true,CONFLICT_RESOLUTION_STRATEGY_OVERWRITE,false);
    +    /** Indicates that if a key has a value at both an ancestor and a descendant, the
descendant and his descendants
    +     * should attempt to merge the values. If the values are not mergable behaviour is
    +     * (and often the descendant's value will simply overwrite). */
    +    public static BasicConfigInheritance DEEP_MERGE = new BasicConfigInheritance(true,CONFLICT_RESOLUTION_STRATEGY_DEEP_MERGE,false);
    +    // reinheritable? true/false; if false, children/descendants/inheritors will never
see it; default true
    --- End diff --
    Use javadoc (given that it's protected, rather than private).

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.

View raw message