tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
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
Date Fri, 28 Aug 2015 10:34:21 GMT
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 <anatole@apache.org>
Authored: Fri Aug 28 12:12:55 2015 +0200
Committer: anatole <anatole@apache.org>
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.
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-api</artifactId>
+            <artifactId>tamaya-java7-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <!-- Test scope only, do not create a code dependency! -->
         <dependency>
             <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-core</artifactId>
+            <artifactId>tamaya-java7-core</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>

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<String> INFO_JSON_QUERY = new ConfigQuery<String>(){
-        @Override
-        public String query(Configuration config) {
-            StringBuilder builder = new StringBuilder();
-            Map<String,String> 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<String,String> en: props.entrySet()){
-                builder.append("     \"" + escape(en.getKey()) +"\": \""+escape(en.getValue())+"\",\n");
-            }
-            builder.append("    }\n}");
-            return builder.toString();
-        }
-    };
-    private static final ConfigQuery<String> INFO_XML_QUERY = new ConfigQuery<String>(){
-        @Override
-        public String query(Configuration config) {
-            StringBuilder builder = new StringBuilder();
-            Map<String,String> props = new TreeMap<>(config.getProperties());
-            builder.append("<configuration>\n")
-                    .append("  <class>"+ config.getClass().getName() + "</class>\n")
-                    .append("  <timestamp>" + System.currentTimeMillis() + "</timestamp>\n")
-                    .append("  <data>\n");
-            for(Map.Entry<String,String> en: props.entrySet()){
-                builder.append("     <entry key=\"" + escape(en.getKey()) +"\">"+escape(en.getValue())+"</entry>\n");
-            }
-            builder.append("   </data>\n</configuration>\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("</body>\n</html>\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("<html>\n<head><title>System Configuration</title></head>\n"
+
+                "<body>\n" +
+                "<h1>Sysem Configuration</h1>\n" +
+                "<p>This view shows the system configuration of " + host + " at " +
new Date() + ".</p>");
 
+    }
 
     /**
      * 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<String, String>()
{
                         @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<String> query(Configuration config) {
                 final Set<String> 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<Set<String>> sections(final Predicate<String>
predicate) {
-        return new ConfigQuery<Set<String>>(){
+        return new ConfigQuery<Set<String>>() {
             @Override
             public Set<String> query(Configuration config) {
                 Set<String> 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<Set<String>> transitiveSections(final Predicate<String>
predicate) {
-        return new ConfigQuery<Set<String>>(){
+        return new ConfigQuery<Set<String>>() {
             @Override
             public Set<String> query(Configuration config) {
                 Set<String> 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<String,
String>() {
@@ -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<String, String>()
{
                         @Override
                         public String apply(String s) {
@@ -335,15 +337,146 @@ public final class ConfigurationFunctions {
      * @return the given query.
      */
     public static ConfigQuery<String> 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<String> jsonInfo(final Map<String,String> info)
{
+        return new ConfigQuery<String>() {
+            @Override
+            public String query(Configuration config) {
+                StringBuilder builder = new StringBuilder();
+                Map<String, String> 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<String, String> en : info.entrySet()) {
+                        builder.append("     \"" + escape(en.getKey()) + "\": \"" + escape(en.getValue())
+ "\",\n");
+                    }
+                    builder.append("  },\n");
+                }
+                builder.append("  \"data\": {\n");
+                for (Map.Entry<String, String> 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<String> 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<String> xmlInfo(final Map<String,String> info)
{
+        return new ConfigQuery<String>() {
+            @Override
+            public String query(Configuration config) {
+                StringBuilder builder = new StringBuilder();
+                Map<String, String> props = new TreeMap<>(config.getProperties());
+                builder.append("<configuration>\n")
+                        .append("  <class>" + config.getClass().getName() + "</class>\n")
+                        .append("  <timestamp>" + System.currentTimeMillis() + "</timestamp>\n");
+                if (info!=null && !info.isEmpty()) {
+                    builder.append("  <info>\n");
+                    for (Map.Entry<String, String> en : info.entrySet()) {
+                        builder.append("     <entry key=\"" + escape(en.getKey()) + "\">"
+ escape(en.getValue()) + "</entry>\n");
+                    }
+                    builder.append("  </info>\n");
+                }
+                builder.append("  <data>\n");
+                for (Map.Entry<String, String> en : props.entrySet()) {
+                    builder.append("     <entry key=\"" + escape(en.getKey()) + "\">"
+ escape(en.getValue()) + "</entry>\n");
+                }
+                builder.append("   </data>\n</configuration>\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<String> 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<String> textInfo(final Map<String,String> info)
{
+        return new ConfigQuery<String>() {
+            @Override
+            public String query(Configuration config) {
+                StringBuilder builder = new StringBuilder();
+                Map<String, String> 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<String, String> en : info.entrySet()) {
+                        builder.append("    " + escape(en.getKey()) + ": " + escape(en.getValue()).replace("\n",
"\n     ") + "\n");
+                    }
+                }
+                builder.append("  data:\n");
+                for (Map.Entry<String, String> 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<String> 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<String> htmlInfo(final Map<String,String> info)
{
+        return new ConfigQuery<String>() {
+            @Override
+            public String query(Configuration config) {
+                StringBuilder builder = new StringBuilder();
+                addHeader(builder);
+                builder.append("<pre>\n").append(textInfo(info).query(config)).append("</pre>\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> T get(String key, Class<T> type) {
+        return (T)get(key, TypeLiteral.of(type));
+    }
+
+    @Override
     public <T> T get(String key, TypeLiteral<T> 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> T query(ConfigQuery<T> 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<String,String> getProperties(){
         final Map<String,String> result = new HashMap<>();
         for(Map.Entry<String,String> 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> T get(String key, Class<T> type) {
+        return (T)get(key, TypeLiteral.of(type));
+    }
+
+    @Override
     public <T> T get(String key, TypeLiteral<T> 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> T query(ConfigQuery<T> 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.
     <name>Apache Tamaya Modules - Java Management Extensions</name>
     <packaging>jar</packaging>
 
+    <properties>
+        <jdkVersion>1.7</jdkVersion>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>

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


Mime
View raw message