Return-Path: X-Original-To: apmail-tamaya-commits-archive@minotaur.apache.org Delivered-To: apmail-tamaya-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0FE7180BA for ; Fri, 28 Aug 2015 10:34:26 +0000 (UTC) Received: (qmail 15477 invoked by uid 500); 28 Aug 2015 10:34:26 -0000 Delivered-To: apmail-tamaya-commits-archive@tamaya.apache.org Received: (qmail 15451 invoked by uid 500); 28 Aug 2015 10:34:26 -0000 Mailing-List: contact commits-help@tamaya.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tamaya.incubator.apache.org Delivered-To: mailing list commits@tamaya.incubator.apache.org Received: (qmail 15442 invoked by uid 99); 28 Aug 2015 10:34:26 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 10:34:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6519BEF16A for ; Fri, 28 Aug 2015 10:34:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.353 X-Spam-Level: X-Spam-Status: No, score=0.353 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.427] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Ru2f-ENr3ftc for ; Fri, 28 Aug 2015 10:34:24 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id C3C0E25784 for ; Fri, 28 Aug 2015 10:34:22 +0000 (UTC) Received: (qmail 15375 invoked by uid 99); 28 Aug 2015 10:34:21 -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; Fri, 28 Aug 2015 10:34:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 92A81E0574; Fri, 28 Aug 2015 10:34:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anatole@apache.org To: commits@tamaya.incubator.apache.org Date: Fri, 28 Aug 2015 10:34:21 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-tamaya git commit: - Ensured functions module is compatible with Java 7. - Ensured management module is compatible with Java 7. - Added small feature to info queries to provide an additional (optional) info map to be included in the repor Repository: incubator-tamaya Updated Branches: refs/heads/master ced71fe23 -> 0c97691b9 - Ensured functions module is compatible with Java 7. - Ensured management module is compatible with Java 7. - Added small feature to info queries to provide an additional (optional) info map to be included in the report payload. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/5483221f Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/5483221f Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/5483221f Branch: refs/heads/master Commit: 5483221f69ce882382b73fa5b9daa3e68ae47ec9 Parents: ced71fe Author: anatole Authored: Fri Aug 28 12:12:55 2015 +0200 Committer: anatole Committed: Fri Aug 28 12:12:55 2015 +0200 ---------------------------------------------------------------------- modules/functions/pom.xml | 4 +- .../functions/ConfigurationFunctions.java | 241 ++++++++++++++----- .../tamaya/functions/FilteredConfiguration.java | 22 ++ .../functions/FilteredPropertySource.java | 10 + .../tamaya/functions/MappedConfiguration.java | 22 ++ .../tamaya/functions/MappedPropertySource.java | 5 + .../functions/MetaEnrichedPropertySource.java | 10 + .../functions/ValueFilteredPropertySource.java | 5 + modules/management/pom.xml | 4 + .../apache/tamaya/management/ManagedConfig.java | 6 + .../tamaya/management/ManagedConfigMBean.java | 4 +- 11 files changed, 274 insertions(+), 59 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/pom.xml ---------------------------------------------------------------------- diff --git a/modules/functions/pom.xml b/modules/functions/pom.xml index 2410f1b..631b2c9 100644 --- a/modules/functions/pom.xml +++ b/modules/functions/pom.xml @@ -38,13 +38,13 @@ under the License. org.apache.tamaya - tamaya-api + tamaya-java7-api ${project.version} org.apache.tamaya - tamaya-core + tamaya-java7-core ${project.version} test http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java b/modules/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java index 34b0129..2968cfc 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java @@ -22,58 +22,54 @@ import org.apache.tamaya.ConfigOperator; import org.apache.tamaya.ConfigQuery; import org.apache.tamaya.Configuration; +import java.net.Inet4Address; import java.util.Arrays; +import java.util.Collections; +import java.util.Date; import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Accessor that provides useful functions along with configuration. */ public final class ConfigurationFunctions { - private static final ConfigQuery INFO_JSON_QUERY = new ConfigQuery(){ - @Override - public String query(Configuration config) { - StringBuilder builder = new StringBuilder(); - Map props = new TreeMap<>(config.getProperties()); - builder.append("\"configuration\": {\n") - .append(" \"class\": \""+ config.getClass().getName() + "\",\n") - .append(" \"timestamp\": " + System.currentTimeMillis() + ",\n") - .append(" \"data\": {\n"); - for(Map.Entry en: props.entrySet()){ - builder.append(" \"" + escape(en.getKey()) +"\": \""+escape(en.getValue())+"\",\n"); - } - builder.append(" }\n}"); - return builder.toString(); - } - }; - private static final ConfigQuery INFO_XML_QUERY = new ConfigQuery(){ - @Override - public String query(Configuration config) { - StringBuilder builder = new StringBuilder(); - Map props = new TreeMap<>(config.getProperties()); - builder.append("\n") - .append(" "+ config.getClass().getName() + "\n") - .append(" " + System.currentTimeMillis() + "\n") - .append(" \n"); - for(Map.Entry en: props.entrySet()){ - builder.append(" "+escape(en.getValue())+"\n"); - } - builder.append(" \n\n"); - return builder.toString(); + /** + * The Logger used. + */ + private static final Logger LOG = Logger.getLogger(ConfigurationFunctions.class.getName()); + + + private static void addFooter(StringBuilder b) { + b.append("\n\n"); + } + + private static void addHeader(StringBuilder b) { + String host = "unknown"; + try { + host = Inet4Address.getLocalHost().getHostName(); + } catch (Exception e) { + LOG.log(Level.INFO, "Failed to lookup hostname.", e); } - }; + b.append("\nSystem Configuration\n" + + "\n" + + "

Sysem Configuration

\n" + + "

This view shows the system configuration of " + host + " at " + new Date() + ".

"); + } /** * Replaces new lines, returns, tabs and '"' with escaped variants. + * * @param text the input text, not null * @return the escaped text. */ - private static String escape(String text){ - return text.replace("\n", "\\n").replace("\r", "\\r").replace("\t", "\\t").replace("\"", "\\\""); + private static String escape(String text) { + return text.replace("\t", "\\t").replace("\"", "\\\""); } /** @@ -146,7 +142,7 @@ public final class ConfigurationFunctions { return isKeyInSection(k, areaKey); } }, "section: " + areaKey); - if(stripKeys){ + if (stripKeys) { return new MappedConfiguration(filtered, new Function() { @Override public String apply(String k) { @@ -162,26 +158,32 @@ public final class ConfigurationFunctions { /** * Calculates the current section key and compares it with the given key. * - * @param key the fully qualified entry key, not null + * @param key the fully qualified entry key, not null * @param sectionKey the section key, not null * @return true, if the entry is exact in this section */ public static boolean isKeyInSection(String key, String sectionKey) { int lastIndex = key.lastIndexOf('.'); - String curAreaKey = lastIndex > 0 ? key.substring(0, lastIndex) : ""; - return curAreaKey.equals(sectionKey); + if(lastIndex<0){ + return false; + } + String curAreaKey = key.substring(0, lastIndex); + if(curAreaKey.startsWith(sectionKey)){ + return true; + } + return false; } /** * Calculates the current section key and compares it with the given section keys. * - * @param key the fully qualified entry key, not null + * @param key the fully qualified entry key, not null * @param sectionKeys the section keys, not null * @return true, if the entry is exact in this section */ public static boolean isKeyInSections(String key, String... sectionKeys) { - for(String areaKey:sectionKeys){ - if(isKeyInSection(key, areaKey)){ + for (String areaKey : sectionKeys) { + if (isKeyInSection(key, areaKey)) { return true; } } @@ -200,7 +202,7 @@ public final class ConfigurationFunctions { @Override public Set query(Configuration config) { final Set areas = new TreeSet<>(); - for(String s: config.getProperties().keySet()) { + for (String s : config.getProperties().keySet()) { int index = s.lastIndexOf('.'); if (index > 0) { areas.add(s.substring(0, index)); @@ -248,12 +250,12 @@ public final class ConfigurationFunctions { * @return s set with all sections, never {@code null}. */ public static ConfigQuery> sections(final Predicate predicate) { - return new ConfigQuery>(){ + return new ConfigQuery>() { @Override public Set query(Configuration config) { Set result = new TreeSet<>(); - for(String s : sections().query(config)){ - if(predicate.test(s)){ + for (String s : sections().query(config)) { + if (predicate.test(s)) { result.add(s); } } @@ -273,12 +275,12 @@ public final class ConfigurationFunctions { * @return s set with all transitive sections, never {@code null}. */ public static ConfigQuery> transitiveSections(final Predicate predicate) { - return new ConfigQuery>(){ + return new ConfigQuery>() { @Override public Set query(Configuration config) { Set result = new TreeSet<>(); - for(String s: transitiveSections().query(config)){ - if(predicate.test(s)){ + for (String s : transitiveSections().query(config)) { + if (predicate.test(s)) { result.add(s); } } @@ -303,12 +305,12 @@ public final class ConfigurationFunctions { * Creates a ConfigOperator that creates a Configuration containing only keys * that are contained in the given section (recursive). * - * @param sectionKeys the section keys, not null - * @param stripKeys if set to true, the section key is stripped away fromMap the resulting key. + * @param sectionKeys the section keys, not null + * @param stripKeys if set to true, the section key is stripped away fromMap the resulting key. * @return the section configuration, with the areaKey stripped away. */ public static ConfigOperator sectionRecursive(final boolean stripKeys, final String... sectionKeys) { - return new ConfigOperator(){ + return new ConfigOperator() { @Override public Configuration operate(Configuration config) { Configuration filtered = new FilteredConfiguration(config, new BiPredicate() { @@ -316,8 +318,8 @@ public final class ConfigurationFunctions { public boolean test(final String k, String v) { return isKeyInSections(k, sectionKeys); } - } , "sections: " + Arrays.toString(sectionKeys)); - if(stripKeys){ + }, "sections: " + Arrays.toString(sectionKeys)); + if (stripKeys) { return new MappedConfiguration(filtered, new Function() { @Override public String apply(String s) { @@ -335,15 +337,146 @@ public final class ConfigurationFunctions { * @return the given query. */ public static ConfigQuery jsonInfo() { - return INFO_JSON_QUERY; + return jsonInfo(null); + } + + /** + * Creates a ConfigQuery that creates a JSON formatted ouitput of all properties in the given configuration. + * @param info the additional information attributes to be added to the output, e.g. the original request + * parameters. + * @return the given query. + */ + public static ConfigQuery jsonInfo(final Map info) { + return new ConfigQuery() { + @Override + public String query(Configuration config) { + StringBuilder builder = new StringBuilder(); + Map props = new TreeMap<>(config.getProperties()); + builder.append("\"configuration\": {\n") + .append(" \"class\": \"" + config.getClass().getName() + "\",\n") + .append(" \"timestamp\": " + System.currentTimeMillis() + ",\n"); + if (info!=null && !info.isEmpty()) { + builder.append(" \"info\": {\n"); + for (Map.Entry en : info.entrySet()) { + builder.append(" \"" + escape(en.getKey()) + "\": \"" + escape(en.getValue()) + "\",\n"); + } + builder.append(" },\n"); + } + builder.append(" \"data\": {\n"); + for (Map.Entry en : props.entrySet()) { + builder.append(" \"" + escape(en.getKey()) + "\": \"" + escape(en.getValue()) + "\",\n"); + } + builder.append(" }\n}"); + return builder.toString(); + } + }; } /** * Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration. + * * @return the given query. */ public static ConfigQuery xmlInfo() { - return INFO_XML_QUERY; + return xmlInfo(null); + } + + /** + * Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration. + * @param info the additional information attributes to be added to the output, e.g. the original request + * parameters. + * @return the given query. + */ + public static ConfigQuery xmlInfo(final Map info) { + return new ConfigQuery() { + @Override + public String query(Configuration config) { + StringBuilder builder = new StringBuilder(); + Map props = new TreeMap<>(config.getProperties()); + builder.append("\n") + .append(" " + config.getClass().getName() + "\n") + .append(" " + System.currentTimeMillis() + "\n"); + if (info!=null && !info.isEmpty()) { + builder.append(" \n"); + for (Map.Entry en : info.entrySet()) { + builder.append(" " + escape(en.getValue()) + "\n"); + } + builder.append(" \n"); + } + builder.append(" \n"); + for (Map.Entry en : props.entrySet()) { + builder.append(" " + escape(en.getValue()) + "\n"); + } + builder.append(" \n\n"); + return builder.toString(); + } + }; + } + + /** + * Creates a ConfigQuery that creates a plain text formatted ouitput of all properties in the given configuration. + * + * @return the given query. + */ + public static ConfigQuery textInfo() { + return textInfo(null); + } + + /** + * Creates a ConfigQuery that creates a plain text formatted ouitput of all properties in the given configuration. + * + * @return the given query. + */ + public static ConfigQuery textInfo(final Map info) { + return new ConfigQuery() { + @Override + public String query(Configuration config) { + StringBuilder builder = new StringBuilder(); + Map props = new TreeMap<>(config.getProperties()); + builder.append("configuration:\n") + .append(" class : " + config.getClass().getName() + "\n") + .append(" timestamp : " + System.currentTimeMillis() + "\n"); + if (info != null && !info.isEmpty()) { + builder.append(" info:\n"); + for (Map.Entry en : info.entrySet()) { + builder.append(" " + escape(en.getKey()) + ": " + escape(en.getValue()).replace("\n", "\n ") + "\n"); + } + } + builder.append(" data:\n"); + for (Map.Entry en : props.entrySet()) { + builder.append(" " + escape(en.getKey()) + ": " + escape(en.getValue()).replace("\n", "\n ") + ",\n"); + } + builder.append("\n"); + return builder.toString(); + } + }; + } + + /** + * Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration. + * + * @return the given query. + */ + public static ConfigQuery htmlInfo() { + return htmlInfo(null); + } + + /** + * Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration. + * + * @return the given query. + */ + public static ConfigQuery htmlInfo(final Map info) { + return new ConfigQuery() { + @Override + public String query(Configuration config) { + StringBuilder builder = new StringBuilder(); + addHeader(builder); + builder.append("
\n").append(textInfo(info).query(config)).append("
\n"); + addFooter(builder); + return builder.toString(); + } + }; } } http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java b/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java index 8797211..5eb7ebd 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java @@ -18,6 +18,8 @@ */ package org.apache.tamaya.functions; +import org.apache.tamaya.ConfigOperator; +import org.apache.tamaya.ConfigQuery; import org.apache.tamaya.Configuration; import org.apache.tamaya.TypeLiteral; @@ -42,6 +44,16 @@ class FilteredConfiguration implements Configuration { } @Override + public String get(String key) { + return get(key, String.class); + } + + @Override + public T get(String key, Class type) { + return (T)get(key, TypeLiteral.of(type)); + } + + @Override public T get(String key, TypeLiteral type) { String value = baseConfiguration.get(key); if (filter.test(key, value)) { @@ -62,6 +74,16 @@ class FilteredConfiguration implements Configuration { } @Override + public Configuration with(ConfigOperator operator) { + return null; + } + + @Override + public T query(ConfigQuery query) { + return query.query(this); + } + + @Override public String toString() { return "FilteredConfiguration{" + "baseConfiguration=" + baseConfiguration + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java b/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java index 119ec71..ed3a350 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java @@ -53,6 +53,11 @@ class FilteredPropertySource implements PropertySource { } @Override + public String get(String key) { + return getProperties().get(key); + } + + @Override public Map getProperties(){ final Map result = new HashMap<>(); for(Map.Entry en: this.baseSource.getProperties().entrySet()) { @@ -64,6 +69,11 @@ class FilteredPropertySource implements PropertySource { } @Override + public boolean isScannable() { + return baseSource.isScannable(); + } + + @Override public String toString() { return "FilteredPropertySource{" + "baseSource=" + baseSource + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java b/modules/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java index a4b729b..1fb8c38 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java @@ -18,6 +18,8 @@ */ package org.apache.tamaya.functions; +import org.apache.tamaya.ConfigOperator; +import org.apache.tamaya.ConfigQuery; import org.apache.tamaya.Configuration; import org.apache.tamaya.TypeLiteral; @@ -42,6 +44,16 @@ class MappedConfiguration implements Configuration { } @Override + public String get(String key) { + return get(key, String.class); + } + + @Override + public T get(String key, Class type) { + return (T)get(key, TypeLiteral.of(type)); + } + + @Override public T get(String key, TypeLiteral type) { return baseConfiguration.get(this.keyMapper.apply(key), type); } @@ -57,6 +69,16 @@ class MappedConfiguration implements Configuration { } @Override + public Configuration with(ConfigOperator operator) { + return operator.operate(this); + } + + @Override + public T query(ConfigQuery query) { + return query.query(this); + } + + @Override public String toString() { return "FilteredConfiguration{" + "baseConfiguration=" + baseConfiguration + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java b/modules/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java index 3717fbb..ce2bcac 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java @@ -76,6 +76,11 @@ class MappedPropertySource implements PropertySource { } @Override + public boolean isScannable() { + return propertySource.isScannable(); + } + + @Override public String get(String key) { return getProperties().get(key); } http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java b/modules/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java index c2aeb8e..42b5957 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java @@ -54,6 +54,11 @@ class MetaEnrichedPropertySource implements PropertySource { } @Override + public int getOrdinal() { + return basePropertySource.getOrdinal(); + } + + @Override public String getName() { return basePropertySource.getName(); } @@ -71,6 +76,11 @@ class MetaEnrichedPropertySource implements PropertySource { } @Override + public boolean isScannable() { + return basePropertySource.isScannable(); + } + + @Override public String toString() { return "MetaEnrichedPropertySource{" + "basePropertySource=" + basePropertySource + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java ---------------------------------------------------------------------- diff --git a/modules/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java b/modules/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java index cdbc577..f6a7d0d 100644 --- a/modules/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java +++ b/modules/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java @@ -68,6 +68,11 @@ class ValueFilteredPropertySource implements PropertySource{ } @Override + public boolean isScannable() { + return source.isScannable(); + } + + @Override public String toString() { return "ValueFilteredPropertySource{" + "source=" + source.getName() + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/management/pom.xml ---------------------------------------------------------------------- diff --git a/modules/management/pom.xml b/modules/management/pom.xml index f519307..ba11a28 100644 --- a/modules/management/pom.xml +++ b/modules/management/pom.xml @@ -31,6 +31,10 @@ under the License. Apache Tamaya Modules - Java Management Extensions jar + + 1.7 + + org.apache.tamaya http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java ---------------------------------------------------------------------- diff --git a/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java b/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java index 970f8ce..91b8256 100644 --- a/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java +++ b/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java @@ -90,6 +90,12 @@ public class ManagedConfig implements ManagedConfigMBean { ConfigurationFunctions.section(area)).getProperties().isEmpty(); } + @Override + public boolean isAreaEmpty(String area) { + return getSection(area, true).isEmpty(); + } + + /** * Evaluate the current configuration. By default this class is temporarely setting the * TCCL to the instance active on bean creation and then calls {@link ConfigurationProvider#getConfiguration()}. http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5483221f/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java ---------------------------------------------------------------------- diff --git a/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java b/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java index 746d494..7fa1eef 100644 --- a/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java +++ b/modules/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java @@ -114,8 +114,6 @@ public interface ManagedConfigMBean { * @param area the target section key, not null. * @return true, if such an section exists and is not empty. */ - default boolean isAreaEmpty(String area){ - return getSection(area, true).isEmpty(); - } + boolean isAreaEmpty(String area); } \ No newline at end of file