Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E5B0200B88 for ; Thu, 22 Sep 2016 13:45:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1CF9E160AD0; Thu, 22 Sep 2016 11:45:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6163C160AAD for ; Thu, 22 Sep 2016 13:45:07 +0200 (CEST) Received: (qmail 25357 invoked by uid 500); 22 Sep 2016 11:45:06 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 25341 invoked by uid 99); 22 Sep 2016 11:45:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2016 11:45:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ECDB2E04BA; Thu, 22 Sep 2016 11:45:05 +0000 (UTC) From: ahgittin To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #340: ConfigMap refactor, respecting inheritanc... Content-Type: text/plain Message-Id: <20160922114505.ECDB2E04BA@git1-us-west.apache.org> Date: Thu, 22 Sep 2016 11:45:05 +0000 (UTC) archived-at: Thu, 22 Sep 2016 11:45:08 -0000 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 ReferenceWithError> getConfigAndContainer(ConfigKey key) { + return getConfigImpl(key, false); + } + + protected abstract TContainer getParentOfContainer(TContainer container); + + @Nullable protected final ConfigKey getKeyAtContainer(TContainer container, ConfigKey queryKey) { + if (container==null) return null; + @SuppressWarnings("unchecked") + ConfigKey candidate = (ConfigKey) getKeyAtContainerImpl(container, queryKey); + return candidate; + } + + @Nullable protected abstract ConfigKey getKeyAtContainerImpl(@Nonnull TContainer container, ConfigKey queryKey); + + protected Maybe getRawValueAtContainer(TContainer container, ConfigKey configKey) { + return ((BrooklynObjectInternal)container).config().getInternalConfigMap().getConfigLocalRaw(configKey); + } + protected Maybe 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. ---