tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [03/10] incubator-tamaya git commit: Removed unused dormant parts. Moved usable dormant utils into new sandbox module. Fixed jqassistant issues in simple metamodel module.
Date Tue, 05 May 2015 11:11:22 GMT
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java
new file mode 100644
index 0000000..1b731c1
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredConfiguration.java
@@ -0,0 +1,52 @@
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.TypeLiteral;
+
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BiPredicate;
+import java.util.stream.Collectors;
+
+/**
+ * Configuration that filters part of the entries defined by a filter predicate.
+ */
+class FilteredConfiguration implements Configuration {
+
+    private final Configuration baseConfiguration;
+    private final BiPredicate<String, String> filter;
+    private String filterType;
+
+    FilteredConfiguration(Configuration baseConfiguration, BiPredicate<String, String> filter, String filterType) {
+        this.baseConfiguration = Objects.requireNonNull(baseConfiguration);
+        this.filter = Objects.requireNonNull(filter);
+        this.filterType = Optional.ofNullable(filterType).orElse(this.filter.toString());
+    }
+
+    @Override
+    public <T> T get(String key, TypeLiteral<T> type) {
+        String value = baseConfiguration.get(key);
+        if (filter.test(key, value)) {
+            return baseConfiguration.get(key, type);
+        }
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        return baseConfiguration.getProperties().entrySet().stream().filter(
+                en -> filter.test(en.getKey(), en.getValue())).collect(Collectors.toMap(
+                en -> en.getKey(), en -> en.getValue()
+        ));
+    }
+
+    @Override
+    public String toString() {
+        return "FilteredConfiguration{" +
+                "baseConfiguration=" + baseConfiguration +
+                ", filter=" + filter +
+                '}';
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java
new file mode 100644
index 0000000..38c29dd
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/FilteredPropertySource.java
@@ -0,0 +1,66 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Predicate;
+
+class FilteredPropertySource implements PropertySource {
+
+    private PropertySource baseSource;
+    private Predicate<String> filter;
+
+    public FilteredPropertySource(PropertySource baseSource, Predicate<String> filter){
+        this.baseSource = Objects.requireNonNull(baseSource);
+        this.filter = Objects.requireNonNull(filter);
+    }
+
+    @Override
+    public int getOrdinal(){
+        return baseSource.getOrdinal();
+    }
+
+    @Override
+    public String getName() {
+        return baseSource.getName();
+    }
+
+    @Override
+    public Map<String,String> getProperties(){
+        final Map<String,String> result = new HashMap<>();
+        this.baseSource.getProperties().entrySet().forEach(e -> {
+            if(filter.test(e.getKey())){
+                result.put(e.getKey(), e.getValue());
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "FilteredPropertySource{" +
+                "baseSource=" + baseSource +
+                ", filter=" + filter +
+                '}';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java
new file mode 100644
index 0000000..a7af911
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedConfiguration.java
@@ -0,0 +1,48 @@
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.TypeLiteral;
+
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BiPredicate;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Configuration that filters part of the entries defined by a filter predicate.
+ */
+class MappedConfiguration implements Configuration {
+
+    private final Configuration baseConfiguration;
+    private final Function<String, String> keyMapper;
+    private final String mapType;
+
+    MappedConfiguration(Configuration baseConfiguration, Function<String, String> keyMapper, String mapType) {
+        this.baseConfiguration = Objects.requireNonNull(baseConfiguration);
+        this.keyMapper = Objects.requireNonNull(keyMapper);
+        this.mapType = Optional.ofNullable(mapType).orElse(this.keyMapper.toString());
+    }
+
+    @Override
+    public <T> T get(String key, TypeLiteral<T> type) {
+        return baseConfiguration.get(this.keyMapper.apply(key), type);
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        return baseConfiguration.getProperties().entrySet().stream().collect(Collectors.toMap(
+                en -> keyMapper.apply(en.getKey()), en -> en.getValue()
+        ));
+    }
+
+    @Override
+    public String toString() {
+        return "FilteredConfiguration{" +
+                "baseConfiguration=" + baseConfiguration +
+                ", mapping=" + mapType +
+                '}';
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java
new file mode 100644
index 0000000..ae37168
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MappedPropertySource.java
@@ -0,0 +1,66 @@
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.UnaryOperator;
+
+/**
+ * PropertySource implementation that maps certain parts (defined by an {@code UnaryOperator<String>}) to alternate areas.
+ */
+class MappedPropertySource implements PropertySource {
+
+	private static final long serialVersionUID = 8690637705511432083L;
+
+	/** The mapping operator. */
+    private UnaryOperator<String> keyMapper;
+    /** The base configuration. */
+    private PropertySource propertySource;
+
+    /**
+     * Creates a new instance.
+     * @param config the base configuration, not null
+     * @param keyMapper The mapping operator, not null
+     */
+    public MappedPropertySource(PropertySource config, UnaryOperator<String> keyMapper) {
+        this.propertySource = Objects.requireNonNull(config);
+        this.keyMapper = Objects.requireNonNull(keyMapper);
+    }
+
+    @Override
+    public int getOrdinal(){
+        return this.propertySource.getOrdinal();
+    }
+
+    @Override
+    public String getName(){
+        return this.propertySource.getName()+"[mapped]";
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        Map<String, String> result = new HashMap<>();
+        Map<String, String> map = this.propertySource.getProperties();
+        map.forEach((k,v) -> {
+            String targetKey = keyMapper.apply(k);
+            if(targetKey!=null){
+                result.put(targetKey, v);
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public Optional<String> get(String key){
+        return Optional.of(getProperties().get(key));
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return this.propertySource.isEmpty();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java
new file mode 100644
index 0000000..f43d65e
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/MetaEnrichedPropertySource.java
@@ -0,0 +1,62 @@
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Configuration that filters part of the entries defined by a filter predicate.
+ */
+class MetaEnrichedPropertySource implements PropertySource {
+
+    private final PropertySource basePropertySource;
+    private final Map<String, String> metaInfo;
+
+    MetaEnrichedPropertySource(PropertySource basePropertySource, Map<String, String> metaInfo) {
+        this.basePropertySource = Objects.requireNonNull(basePropertySource);
+        this.metaInfo = Objects.requireNonNull(metaInfo);
+    }
+
+    // [meta:origin]a.b.c
+    @Override
+    public String get(String key) {
+        if(key.startsWith("[meta:")){
+            key = key.substring(6);
+            int index = key.indexOf(']');
+            String metaKey = key.substring(0,index);
+            String entryKey = key.substring(index+1);
+            String value =  basePropertySource.get(entryKey);
+            if(value!=null) {
+                return metaInfo.get(metaKey);
+            }
+        }
+        return basePropertySource.get(key);
+    }
+
+    @Override
+    public String getName() {
+        return basePropertySource.getName();
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        Map<String, String> baseProperties = basePropertySource.getProperties();
+        Map<String, String> allProperties = new HashMap<>(baseProperties);
+        baseProperties.forEach((k,v) -> {
+            this.metaInfo.forEach(
+                (mk, mv) -> allProperties.put("[meta:"+mk+']'+k, mv));
+            });
+        return allProperties;
+    }
+
+    @Override
+    public String toString() {
+        return "MetaEnrichedPropertySource{" +
+                "basePropertySource=" + basePropertySource +
+                ", metaInfo=" + metaInfo +
+                '}';
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/PropertySourceFunctions.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/PropertySourceFunctions.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/PropertySourceFunctions.java
new file mode 100644
index 0000000..52c306a
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/PropertySourceFunctions.java
@@ -0,0 +1,226 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+/**
+ * Accessor that provides useful functions along with configuration.
+ */
+public final class PropertySourceFunctions {
+    /**
+     * Private singleton constructor.
+     */
+    private PropertySourceFunctions() {
+    }
+
+    /**
+     * Creates a ConfigOperator that creates a Configuration containing only keys
+     * that are contained in the given area (non recursive). Hereby
+     * the area key is stripped away fromMap the resulting key.
+     * <p>
+     * Metadata is added only for keys that are present on the original configuration.
+     * They are added in the following format:
+     * <pre>
+     *     Given are
+     *       1) a configuration with two entries: entry1, entry 2
+     *       2) metadata as metaKey1=metaValue1, metaKey2=metaValue2
+     *
+     * The final configuration will look like:
+     *
+     *     entry1=entry1Value;
+     *     entry2=entry2Value;
+     *     [meta:metaKey1]entry1=metaValue1
+     *     [meta:metaKey2]entry1=metaValue2
+     *     [meta:metaKey1]entry2=metaValue1
+     *     [meta:metaKey2]entry2=metaValue2
+     * </pre>
+     *
+     * This mechanism allows to add meta information such as origin, sensitivity, to all keys of a current
+     * PropertySource or Configuration. If done on multiple PropertySources that are combined the corresponding
+     * values are visible in synch with the values visible.
+     *
+     * @param propertySource the base propertySource, not null.
+     * @param metaData the metaData to be added, not null
+     * @return the metadata enriched configuration, not null.
+     */
+    public static PropertySource addMetaData(PropertySource propertySource, Map<String,String> metaData) {
+        return new MetaEnrichedPropertySource(propertySource, metaData);
+    }
+
+    /**
+     * Calculates the current area key and compares it with the given key.
+     *
+     * @param key     the fully qualified entry key, not null
+     * @param areaKey the area key, not null
+     * @return true, if the entry is exact in this area
+     */
+    public static boolean isKeyInArea(String key, String areaKey) {
+        int lastIndex = key.lastIndexOf('.');
+        String curAreaKey = lastIndex > 0 ? key.substring(0, lastIndex) : "";
+        return curAreaKey.equals(areaKey);
+    }
+
+    /**
+     * Calculates the current area key and compares it with the given area keys.
+     *
+     * @param key     the fully qualified entry key, not null
+     * @param areaKeys the area keys, not null
+     * @return true, if the entry is exact in this area
+     */
+    public static boolean isKeyInAreas(String key, String... areaKeys) {
+        for(String areaKey:areaKeys){
+            if(isKeyInArea(key, areaKey)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Return a query to evaluate the set with all fully qualifies area names. This method should return the areas as accurate as possible,
+     * but may not provide a complete set of areas that are finally accessible, especially when the underlying storage
+     * does not support key iteration.
+     *
+     * @return s set with all areas, never {@code null}.
+     */
+    public static Set<String> areas(Map<String,String> map) {
+            final Set<String> areas = new HashSet<>();
+            map.keySet().forEach(s -> {
+                int index = s.lastIndexOf('.');
+                if (index > 0) {
+                    areas.add(s.substring(0, index));
+                } else {
+                    areas.add("<root>");
+                }
+            });
+            return areas;
+    }
+
+    /**
+     * Return a query to evaluate the set with all fully qualified area names, containing the transitive closure also including all
+     * subarea names, regardless if properties are accessible or not. This method should return the areas as accurate
+     * as possible, but may not provide a complete set of areas that are finally accessible, especially when the
+     * underlying storage does not support key iteration.
+     *
+     * @return s set with all transitive areas, never {@code null}.
+     */
+    public static Set<String> transitiveAreas(Map<String,String> map) {
+            final Set<String> transitiveAreas = new HashSet<>();
+            areas(map).forEach(s -> {
+                int index = s.lastIndexOf('.');
+                if (index < 0) {
+                    transitiveAreas.add("<root>");
+                } else {
+                    while (index > 0) {
+                        s = s.substring(0, index);
+                        transitiveAreas.add(s);
+                        index = s.lastIndexOf('.');
+                    }
+                }
+            });
+            return transitiveAreas;
+    }
+
+    /**
+     * Return a query to evaluate the set with all fully qualified area names, containing only the
+     * areas that match the predicate and have properties attached. This method should return the areas as accurate as possible,
+     * but may not provide a complete set of areas that are finally accessible, especially when the underlying storage
+     * does not support key iteration.
+     *
+     * @param predicate A predicate to deternine, which areas should be returned, not {@code null}.
+     * @return s set with all areas, never {@code null}.
+     */
+    public static Set<String> areas(Map<String,String> map, final Predicate<String> predicate) {
+        return
+            areas(map).stream().filter(predicate).collect(Collectors.toCollection(TreeSet::new));
+    }
+
+    /**
+     * Return a query to evaluate the set with all fully qualified area names, containing the transitive closure also including all
+     * subarea names, regardless if properties are accessible or not. This method should return the areas as accurate as possible,
+     * but may not provide a complete set of areas that are finally accessible, especially when the underlying storage
+     * does not support key iteration.
+     *
+     * @param predicate A predicate to deternine, which areas should be returned, not {@code null}.
+     * @return s set with all transitive areas, never {@code null}.
+     */
+    public static Set<String> transitiveAreas(Map<String,String> map, Predicate<String> predicate) {
+        return
+            transitiveAreas(map).stream().filter(predicate).collect(Collectors.toCollection(TreeSet::new));
+    }
+
+
+    /**
+     * Creates a ConfigOperator that creates a Configuration containing only keys
+     * that are contained in the given area (recursive). Hereby
+     * the area key is stripped away fromMap the resulting key.
+     *
+     * @param areaKeys the area keys, not null
+     * @return the area configuration, with the areaKey stripped away.
+     */
+    public static Map<String,String> areasRecursive(Map<String,String> map, String... areaKeys) {
+        return areaRecursive(map, true, areaKeys);
+    }
+
+    /**
+     * Creates a ConfigOperator that creates a Configuration containing only keys
+     * that are contained in the given area (recursive).
+     *
+     * @param areaKeys   the area keys, not null
+     * @param stripKeys if set to true, the area key is stripped away fromMap the resulting key.
+     * @return the area configuration, with the areaKey stripped away.
+     */
+    public static Map<String,String> areaRecursive(Map<String,String> map, boolean stripKeys, String... areaKeys) {
+        if(stripKeys) {
+            return map.entrySet().stream().filter(
+                    (e) -> isKeyInAreas(e.getKey(), areaKeys))
+                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+        }
+        else {
+            return map.entrySet().stream().filter(
+                    (e) -> isKeyInAreas(e.getKey(), areaKeys))
+                    .collect(Collectors.toMap(en -> stripAreaKeys(en.getKey(), areaKeys), Map.Entry::getValue));
+        }
+    }
+
+    /**
+     * Strips the area key of the given absolute key, if it is one of the areaKeys passed.
+     * @param key the current key, not null.
+     * @param areaKeys the areaKeys, not null.
+     * @return the stripped key, or the original key (if no area was matching).
+     */
+    static String stripAreaKeys(String key, String... areaKeys) {
+        for(String areaKey:areaKeys) {
+            if(key.startsWith(areaKey+'.')) {
+                return key.substring(areaKey.length() + 1);
+            }
+        }
+        return key;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java b/sandbox/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java
new file mode 100644
index 0000000..23a5434
--- /dev/null
+++ b/sandbox/functions/src/main/java/org/apache/tamaya/functions/ValueFilteredPropertySource.java
@@ -0,0 +1,55 @@
+package org.apache.tamaya.functions;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.BiFunction;
+
+/**
+ * Property source which filters any key/values dynamically.
+ */
+class ValueFilteredPropertySource implements PropertySource{
+
+    private String name;
+    private BiFunction<String, String, String> valueFilter;
+    private PropertySource source;
+
+    public ValueFilteredPropertySource(String name, BiFunction<String, String, String> valueFilter, PropertySource current) {
+        this.name = Optional.ofNullable(name).orElse("<valueFiltered> -> name="+current.getName()+", valueFilter="+valueFilter.toString());
+    }
+
+    @Override
+    public int getOrdinal() {
+        return source.getOrdinal();
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public Optional<String> get(String key) {
+        String value = this.source.get(key).orElse(null);
+        value = valueFilter.apply(key, value);
+        return Optional.ofNullable(value);
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        Map<String, String> map = new HashMap<>(source.getProperties());
+        map.replaceAll(valueFilter);
+        return map;
+    }
+
+    @Override
+    public String toString() {
+        return "ValueFilteredPropertySource{" +
+                "source=" + source.getName() +
+                ", name='" + name + '\'' +
+                ", valueFilter=" + valueFilter +
+                '}';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/pom.xml b/sandbox/integration/cdi/pom.xml
index 1c9db54..fcecae3 100644
--- a/sandbox/integration/cdi/pom.xml
+++ b/sandbox/integration/cdi/pom.xml
@@ -21,7 +21,7 @@ under the License.
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.tamaya.ext.integration</groupId>
+        <groupId>org.apache.tamaya.ext</groupId>
         <artifactId>tamaya-integrations</artifactId>
         <version>0.1-incubating-SNAPSHOT</version>
     </parent>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java b/sandbox/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
new file mode 100644
index 0000000..2e1473a
--- /dev/null
+++ b/sandbox/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
@@ -0,0 +1,79 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.integration.cdi;
+
+import org.apache.tamaya.core.internal.inject.ConfigurationInjector;
+import org.apache.tamaya.core.internal.inject.ConfiguredType;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Vetoed;
+import javax.enterprise.inject.spi.*;
+import java.util.*;
+
+/**
+ * CDI portable extension that integrates {@link org.apache.tamaya.core.internal.inject.ConfigurationInjector}
+ * with CDI by adding configuration features to CDI (config enable CDI beans).
+ */
+@Vetoed
+public final class ConfigurationExtension implements Extension {
+
+    public <T> void initializeConfiguredFields(final @Observes ProcessInjectionTarget<T> pit) {
+        final AnnotatedType<T> at = pit.getAnnotatedType();
+        if (!ConfiguredType.isConfigured(at.getJavaClass())) {
+            return;
+        }
+        final InjectionTarget<T> it = pit.getInjectionTarget();
+        InjectionTarget<T> wrapped = new InjectionTarget<T>() {
+            @Override
+            public void inject(T instance, CreationalContext<T> ctx) {
+                it.inject(instance, ctx);
+                ConfigurationInjector.configure(instance);
+            }
+
+            @Override
+            public void postConstruct(T instance) {
+                it.postConstruct(instance);
+            }
+
+            @Override
+            public void preDestroy(T instance) {
+                it.dispose(instance);
+            }
+
+            @Override
+            public void dispose(T instance) {
+                it.dispose(instance);
+            }
+
+            @Override
+            public Set<InjectionPoint> getInjectionPoints() {
+                return it.getInjectionPoints();
+            }
+
+            @Override
+            public T produce(CreationalContext<T> ctx) {
+                return it.produce(ctx);
+            }
+        };
+        pit.setInjectionTarget(wrapped);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/main/resources/META-INF/beans.xml b/sandbox/integration/cdi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/sandbox/integration/cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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 current the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/sandbox/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..2249aca
--- /dev/null
+++ b/sandbox/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,19 @@
+#
+# 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 current the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.tamaya.integration.cdi.ConfigurationExtension

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredClass.java b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredClass.java
new file mode 100644
index 0000000..ba92b3e
--- /dev/null
+++ b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredClass.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * 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 current the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.tamaya.integration.cdi;
+
+import java.beans.PropertyChangeEvent;
+import java.math.BigDecimal;
+
+import javax.inject.Singleton;
+
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.ObservesConfigChange;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+@Singleton
+public class ConfiguredClass{
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty
+    private String testProperty;
+
+    @ConfiguredProperty(keys = "a.b.c.key1")
+    @ConfiguredProperty(keys = "a.b.c.key2")
+    @ConfiguredProperty(keys = "a.b.c.key3")
+    @DefaultValue("The current \\${JAVA_HOME} env property is ${env:JAVA_HOME}.")
+    String value1;
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty(keys = "foo")
+    @ConfiguredProperty(keys = "a.b.c.key2")
+    private String value2;
+
+    @ConfiguredProperty
+    @DefaultValue("N/A")
+    private String runtimeVersion;
+
+    @ConfiguredProperty
+    @DefaultValue("${sys:java.version}")
+    private String javaVersion2;
+
+    @ConfiguredProperty
+    @DefaultValue("5")
+    private Integer int1;
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty
+    private int int2;
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty
+    private boolean booleanT;
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty(keys = "BD")
+    private BigDecimal bigNumber;
+
+//    @WithConfig("testdata")
+    @ConfiguredProperty(keys = "double1")
+    private double doubleValue;
+
+    @ObservesConfigChange
+    public void changeListener1(PropertyChangeEvent configChange){
+        // will be called
+    }
+
+    public String getTestProperty() {
+        return testProperty;
+    }
+
+    public String getValue1() {
+        return value1;
+    }
+
+    public String getValue2() {
+        return value2;
+    }
+
+    public String getRuntimeVersion() {
+        return runtimeVersion;
+    }
+
+    public String getJavaVersion2() {
+        return javaVersion2;
+    }
+
+    public Integer getInt1() {
+        return int1;
+    }
+
+    public int getInt2() {
+        return int2;
+    }
+
+    public boolean isBooleanT() {
+        return booleanT;
+    }
+
+    public BigDecimal getBigNumber() {
+        return bigNumber;
+    }
+
+    public double getDoubleValue() {
+        return doubleValue;
+    }
+
+    @Override
+	public String toString(){
+        return super.toString() + ": testProperty="+testProperty+", value1="+value1+", value2="+value2
+                +", int1="+int1+", int2="+int2+", booleanT="+booleanT+", bigNumber="+bigNumber
+                +", runtimeVersion="+runtimeVersion+", javaVersion2="+javaVersion2;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredTest.java
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredTest.java b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredTest.java
new file mode 100644
index 0000000..376df10
--- /dev/null
+++ b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/ConfiguredTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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 current the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.tamaya.integration.cdi;
+
+import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
+import org.hamcrest.MatcherAssert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.enterprise.inject.spi.CDI;
+
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+@RunWith(CdiTestRunner.class)
+public class ConfiguredTest{
+
+    @Ignore
+    @Test
+    public void testInjection(){
+        ConfiguredClass item = CDI.current().select(ConfiguredClass.class).get();
+        System.out.println("********************************************");
+        System.out.println(item);
+        System.out.println("********************************************");
+
+        double actual = 1234.5678;
+
+        MatcherAssert.assertThat(item.getDoubleValue(), is(actual));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/TestConfigProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/TestConfigProvider.java b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/TestConfigProvider.java
new file mode 100644
index 0000000..a10422c
--- /dev/null
+++ b/sandbox/integration/cdi/src/test/java/org/apache/tamaya/integration/cdi/TestConfigProvider.java
@@ -0,0 +1,69 @@
+/*
+ * 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 current the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.integration.cdi;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.core.properties.PropertySourceBuilder;
+import old.ConfigurationProviderSpi;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by Anatole on 29.09.2014.
+ */
+public class TestConfigProvider implements ConfigurationProviderSpi
+{
+
+    private Configuration testConfig;
+
+    public TestConfigProvider(){
+        final Map<String,String> config = new HashMap<>();
+        config.put("a.b.c.key1", "keys current a.b.c.key1");
+        config.put("a.b.c.key2", "keys current a.b.c.key2");
+        config.put("a.b.key3", "keys current a.b.key3");
+        config.put("a.b.key4", "keys current a.b.key4");
+        config.put("a.key5", "keys current a.key5");
+        config.put("a.key6", "keys current a.key6");
+        config.put("int1", "123456");
+        config.put("int2", "111222");
+        config.put("testProperty", "testPropertyValue!");
+        config.put("booleanT", "true");
+        config.put("double1", "1234.5678");
+        config.put("BD", "123456789123456789123456789123456789.123456789123456789123456789123456789");
+        config.put("testProperty", "keys current testProperty");
+        config.put("runtimeVersion", "${java.version}");
+        testConfig = PropertySourceBuilder.of("testdata").addMap(config).build().toConfiguration();
+    }
+
+    @Override
+    public String getConfigName(){
+        return "testdata";
+    }
+
+    @Override
+    public Configuration getConfiguration(){
+        return testConfig;
+    }
+
+    @Override
+    public void reload() {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/cdi/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/integration/cdi/src/test/resources/META-INF/beans.xml b/sandbox/integration/cdi/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/sandbox/integration/cdi/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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 current the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/commons/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/integration/commons/pom.xml b/sandbox/integration/commons/pom.xml
index e11a8f6..c2be1fe 100644
--- a/sandbox/integration/commons/pom.xml
+++ b/sandbox/integration/commons/pom.xml
@@ -21,7 +21,7 @@ under the License.
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.tamaya.ext.integration</groupId>
+        <groupId>org.apache.tamaya.ext</groupId>
         <artifactId>tamaya-integrations</artifactId>
         <version>0.1-incubating-SNAPSHOT</version>
         <relativePath>..</relativePath>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/integration/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/integration/pom.xml b/sandbox/integration/pom.xml
index c239396..476fffd 100644
--- a/sandbox/integration/pom.xml
+++ b/sandbox/integration/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
     <packaging>pom</packaging>
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.tamaya.ext.integration</groupId>
+    <groupId>org.apache.tamaya.ext</groupId>
     <artifactId>tamaya-integrations</artifactId>
 
     <modules>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/management/pom.xml b/sandbox/management/pom.xml
index bdab1d7..07812e1 100644
--- a/sandbox/management/pom.xml
+++ b/sandbox/management/pom.xml
@@ -28,13 +28,13 @@ under the License.
     </parent>
 
     <artifactId>tamaya-management</artifactId>
-    <name>Apache Tamaya Modules Integration - Java Management Extensions</name>
+    <name>Apache Tamaya Modules - Java Management Extensions</name>
     <packaging>jar</packaging>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-core</artifactId>
+            <artifactId>tamaya-api</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java
new file mode 100644
index 0000000..b991690
--- /dev/null
+++ b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfig.java
@@ -0,0 +1,95 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.se;
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.AggregationPolicy;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by Anatole on 24.11.2014.
+ */
+public class ManagedConfig implements ManagedConfigMBean{
+    @Override
+    public Set<String> getConfigurationNames() {
+        return null;
+    }
+
+    @Override
+    public String getConfigurationInfo(String configName) {
+        return null;
+    }
+
+    @Override
+    public boolean isConfigurationAvailable(String configName, String envType, String context) {
+        return false;
+    }
+
+    @Override
+    public boolean isConfigurationLoaded(String configName, String envType, String context) {
+        return false;
+    }
+
+    @Override
+    public Map<String, String> getConfiguration(String configName, String envType, String context) throws ConfigException {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String context) throws ConfigException {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getConfigValues(String area, String configName, String envType, String context) throws ConfigException {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> updateConfiguration(String configName, String envType, String context, Map<String, String> values, AggregationPolicy aggregationPolicy) throws ConfigException {
+        return null;
+    }
+
+    @Override
+    public String getConfigurationInfo(String configName, String envType, String context) {
+        return null;
+    }
+
+    @Override
+    public Set<String> getAreas(String configName, String envType, String context) {
+        return null;
+    }
+
+    @Override
+    public Set<String> getTransitiveAreas(String configName, String envType, String context) {
+        return null;
+    }
+
+    @Override
+    public boolean isAreaExisting(String area, String configName, String envType, String context) {
+        return false;
+    }
+
+    @Override
+    public boolean isAreaEmpty(String area, String configName, String envType, String context) {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
new file mode 100644
index 0000000..c2ade13
--- /dev/null
+++ b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
@@ -0,0 +1,176 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.se;
+
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.AggregationPolicy;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Managed bean interface for accessing environment data.
+ */
+public interface ManagedConfigMBean {
+    /**
+     * Get the names current the configuration's defined.
+     *
+     * @return the names current the configuration's defined.
+     */
+    public Set<String> getConfigurationNames();
+
+    /**
+     * Get a general configuration info descriptor in JSON format for a configuration
+     * type in the following form:
+     * <pre>
+     *     tbd
+     * </pre>
+     *
+     * @param configName the configuration name, not null.
+     * @return a JSON formatted meta-information.
+     */
+    public String getConfigurationInfo(String configName);
+
+    /**
+     * Allows to determine if a configuration current a given type is available (accessible) in the
+     * given environment context.
+     *
+     * @param configName the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return true, if such a configuration is accessible.
+     */
+    public boolean isConfigurationAvailable(String configName, String envType, String envContext);
+
+    /**
+     * Allows to determine if a configuration current a given type is loaded in the
+     * given environment context.
+     *
+     * @param configName the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return true, if such a configuration is accessible.
+     */
+    public boolean isConfigurationLoaded(String configName, String envType, String envContext);
+
+    /**
+     * Accesses a configuration current a given type as Map.
+     *
+     * @param configName the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return true, if such a configuration is accessible.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+     */
+    public Map<String, String> getConfiguration(String configName, String envType, String envContext)
+            throws ConfigException;
+
+    /**
+     * Accesses a configuration values for current a given config area as Map.
+     * @param area the target area key, not null.
+     * @param configName the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return the key/values found, including the recursive child values.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+     */
+    public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String envContext)
+            throws ConfigException;
+
+    /**
+     * Accesses a configuration values for current a given config area as Map.
+     * @param area the target area key, not null.
+     * @param configName the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return the key/values found, not transitive.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+     */
+    public Map<String, String> getConfigValues(String area, String configName, String envType, String envContext)
+            throws ConfigException;
+
+    /**
+     * Updates a configuration current a given type.
+     *
+     * @param configName        the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @param values            the values to be changed.
+     * @param aggregationPolicy the aggregation Policy to be used.
+     * @return the configuration after the changesd have been applied.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded, or not
+     *                                           mutable.
+     */
+    public Map<String, String> updateConfiguration(String configName, String envType, String envContext, Map<String, String> values, AggregationPolicy aggregationPolicy)
+            throws ConfigException;
+
+    /**
+     * Access a JSON formatted info on a configuration loaded in the form as
+     * <pre>
+     *     tbd
+     * </pre>
+     * @param configName        the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return the JSON formatted info, never null.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+     */
+    public String getConfigurationInfo(String configName, String envType, String envContext);
+
+    /**
+     * Access the defined areas for a given configuration.
+     * @param configName        the configuration name, not null.
+     * @param envContext        the environment context, not null.
+     * @return the areas defined (only returning the areas that contain properties).
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+     */
+    public Set<String> getAreas(String configName, String envType, String envContext);
+
+    /**
+     * Access the transitive areas for a given configuration.
+     * @param configName        the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return the transitive areas defined.
+     * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+     */
+    public Set<String> getTransitiveAreas(String configName, String envType, String envContext);
+
+    /**
+     * Allows to determine if an area is existing.
+     * @param area the target area key, not null.
+     * @param configName        the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return true, if such an area exists (the area may be empty).
+     */
+    public boolean isAreaExisting(String area, String configName, String envType, String envContext);
+
+    /**
+     * Allows to determine if an area is empty.
+     * @param area the target area key, not null.
+     * @param configName        the configuration name, not null.
+     * @param envType        the environment context, not null.
+     * @param envContext        the environment context, not null.
+     * @return true, if such an area exists and is not empty.
+     */
+    public boolean isAreaEmpty(String area, String configName, String envType, String envContext);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
new file mode 100644
index 0000000..e85b1c1
--- /dev/null
+++ b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
@@ -0,0 +1,69 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.se;
+
+import org.apache.tamaya.Environment;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * MBean implementation for accessing environment data.
+ * Created by Anatole on 24.11.2014.
+ */
+public class ManagedEnvironment implements ManagedEnvironmentMBean{
+
+    @Override
+    public List<String> getEnvironmentHierarchy() {
+        return Environment.getEnvironmentHierarchy();
+    }
+
+    @Override
+    public String getEnvironmentInfo(String environmentContext) {
+        try {
+            // TODO
+            return "EnvironmentInfo {}";
+        }
+        catch(Exception e){
+            // TODO logging
+            return "EnvironmentInfo{}";
+        }
+    }
+
+    @Override
+    public Map<String, String> getEnvironment(String environmentType, String context) {
+        try {
+            Optional<Environment> env = Environment.getInstance(environmentType, context);
+            if (env.isPresent()) {
+                return env.get().toMap();
+            }
+        } catch (Exception e) {
+            // TODO logging
+        }
+        return Collections.emptyMap();
+    }
+
+    @Override
+    public String getEnvironmentInfo() {
+        // TODO
+        return "EnvironmentInfo {}";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
new file mode 100644
index 0000000..b7cdfc3
--- /dev/null
+++ b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
@@ -0,0 +1,88 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.se;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Managed bean interface for accessing environment data.
+ */
+public interface ManagedEnvironmentMBean {
+
+    /**
+     * Returns the current environment hierarchy defined.
+     * @see org.apache.tamaya.Environment#getEnvironmentType()
+     * @see org.apache.tamaya.Environment#getEnvironmentHierarchy()
+     * @return the current environment type hierarchy defined, never null.
+     */
+    public List<String> getEnvironmentHierarchy();
+
+    /**
+     * Get the common environment information in JSON format, which has the following form:
+     * <pre>
+     * Environment {
+     *     id: "system:VM,domain:testdata",
+     *     metaInfo {
+     *         a: "aValue",
+     *         b: "bValue"
+     *     }
+     *     entries{
+     *         val1: "value1",
+     *         val2: "value2",
+     *     }
+     * }
+     * </pre>
+     * @see org.apache.tamaya.Environment
+     * @param environmentContext the identifier to access the environment instance
+     * @return the environment JSON info, or null, if no such environment is accessible.
+     */
+    public String getEnvironmentInfo(String environmentContext);
+
+    /**
+     * Access the given environment as Map. the {@code environmentContext} is added to the
+     * map using the key {@code __environmentId}.
+     * @param environmentContext the identifier to access the environment instance
+     * @param context the context, not null.
+     * @return a map with the currently defined environment keys and values.
+     */
+    public Map<String,String> getEnvironment(String environmentContext, String context);
+
+    /**
+     * Get a general JSON info on the currently available environments current the form:
+     * <pre>
+     *     EnvironmentInfo{
+     *         host: "hostName",
+     *         ipAddress: "111.112.123.123",
+     *         typeHierarchy: {"system", "domain", "ear", "war", "saas-scope", "tenant"}
+     *         environments {
+     *             Environment {
+     *                 id: "system:VM,domain:testdata",
+     *                 ...
+     *             },
+     *             ...
+     *         }
+     *     }
+     * </pre>
+     * @return
+     */
+    public String getEnvironmentInfo();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/resources/META-INF/beans.xml b/sandbox/management/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/sandbox/management/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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 current the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/management/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/management/src/test/resources/META-INF/beans.xml b/sandbox/management/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/sandbox/management/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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 current the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/pom.xml b/sandbox/pom.xml
index 4e0c2df..8efd9e4 100644
--- a/sandbox/pom.xml
+++ b/sandbox/pom.xml
@@ -39,6 +39,9 @@ under the License.
         <module>integration</module>
         <module>management</module>
         <module>jodatime</module>
+        <module>functions</module>
+        <module>sysprops</module>
+        <module>environment</module>
     </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/sysprops/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/sysprops/pom.xml b/sandbox/sysprops/pom.xml
new file mode 100644
index 0000000..6e62b39
--- /dev/null
+++ b/sandbox/sysprops/pom.xml
@@ -0,0 +1,71 @@
+<!--
+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 current the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.tamaya.ext</groupId>
+        <artifactId>tamaya-sandbox</artifactId>
+        <version>0.1-incubating-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+    <artifactId>tamaya-sysprops</artifactId>
+    <name>Apache Tamaya - Configured Java SE System Properties</name>
+    <packaging>jar</packaging>
+
+    <properties>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>prepare-agent</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>tamaya-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>tamaya-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/46ede97c/sandbox/sysprops/src/main/java/org/apache/tamaya/integration/se/ConfiguredSystemProperties.java
----------------------------------------------------------------------
diff --git a/sandbox/sysprops/src/main/java/org/apache/tamaya/integration/se/ConfiguredSystemProperties.java b/sandbox/sysprops/src/main/java/org/apache/tamaya/integration/se/ConfiguredSystemProperties.java
new file mode 100644
index 0000000..cdef5be
--- /dev/null
+++ b/sandbox/sysprops/src/main/java/org/apache/tamaya/integration/se/ConfiguredSystemProperties.java
@@ -0,0 +1,353 @@
+/*
+ * 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
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.integration.se;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import java.util.logging.Logger;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.Environment;
+
+/**
+ * Properties implementation class that can be applied as current System properties by calling
+ * {@link ConfiguredSystemProperties#install()}. The system properties will
+ * then behave contextually depending on the current runtime configuration active.
+ */
+public class ConfiguredSystemProperties extends Properties {
+
+	private static final long serialVersionUID = 2152870929299226804L;
+
+	private static final Logger LOG = Logger.getLogger(ConfiguredSystemProperties.class.getName());
+    private Properties initialProperties;
+    private static volatile Map<String, Properties> contextualProperties = new ConcurrentHashMap<>();
+    private static volatile Supplier<String> contextProvider = () ->
+            Environment.current().get("context.id").orElse("<system>");
+
+
+    private final Object LOCK = new Object();
+
+
+    private ConfiguredSystemProperties(Properties initialProperties) {
+        super(initialProperties);
+        this.initialProperties = initialProperties;
+    }
+
+    public static void install() {
+        Properties props = System.getProperties();
+        if (props instanceof ConfiguredSystemProperties) {
+            return;
+        }
+        ConfiguredSystemProperties systemProps = new ConfiguredSystemProperties(props);
+        LOG.finest("Installing enhanced system properties...");
+        System.setProperties(systemProps);
+        LOG.info("Installed enhanced system properties successfully.");
+    }
+
+    public static void uninstall() {
+        Properties props = System.getProperties();
+        if (props instanceof ConfiguredSystemProperties) {
+            Properties initialProperties = ((ConfiguredSystemProperties) props).initialProperties;
+            LOG.finest("Uninstalling enhanced system properties...");
+            System.setProperties(initialProperties);
+            LOG.info("Uninstalled enhanced system properties successfully.");
+        }
+    }
+
+    @Override
+    public String getProperty(String key) {
+        return getContextualProperties().getProperty(key);
+    }
+
+    @Override
+    public String getProperty(String key, String defaultValue) {
+        return getContextualProperties().getProperty(key, defaultValue);
+    }
+
+    @Override
+    public Enumeration<?> propertyNames() {
+        return getContextualProperties().propertyNames();
+    }
+
+    @Override
+    public Set<String> stringPropertyNames() {
+        return getContextualProperties().stringPropertyNames();
+    }
+
+    @Override
+    public synchronized int size() {
+        return getContextualProperties().size();
+    }
+
+    @Override
+    public synchronized Enumeration<Object> keys() {
+        return getContextualProperties().keys();
+    }
+
+    @Override
+    public synchronized Enumeration<Object> elements() {
+        return getContextualProperties().elements();
+    }
+
+    @Override
+    public synchronized boolean contains(Object value) {
+        return getContextualProperties().contains(value);
+    }
+
+    @Override
+    public boolean containsValue(Object value) {
+        return getContextualProperties().containsValue(value);
+    }
+
+    @Override
+    public synchronized boolean containsKey(Object key) {
+        return getContextualProperties().containsKey(key);
+    }
+
+    @Override
+    public synchronized Object get(Object key) {
+        return getContextualProperties().get(key);
+    }
+
+    @Override
+    public synchronized Object clone() {
+        return getContextualProperties().clone();
+    }
+
+    @Override
+    public Set<Object> keySet() {
+        return getContextualProperties().keySet();
+    }
+
+    @Override
+    public Set<Map.Entry<Object, Object>> entrySet() {
+        return getContextualProperties().entrySet();
+    }
+
+    @Override
+    public Collection<Object> values() {
+        return getContextualProperties().values();
+    }
+
+
+    @Override
+    public Object getOrDefault(Object key, Object defaultValue) {
+        return getContextualProperties().getOrDefault(key, defaultValue);
+    }
+
+    @Override
+    public void forEach(BiConsumer<? super Object, ? super Object> action) {
+        getContextualProperties().forEach(action);
+    }
+
+
+    @Override
+    public Object computeIfAbsent(Object key, Function<? super Object, ?> mappingFunction) {
+        return getContextualProperties().computeIfAbsent(key, mappingFunction);
+    }
+
+    @Override
+    public synchronized Object computeIfPresent(Object key, BiFunction<? super Object, ? super Object, ?> remappingFunction) {
+        return getContextualProperties().computeIfPresent(key, remappingFunction);
+    }
+
+    @Override
+    public synchronized Object compute(Object key, BiFunction<? super Object, ? super Object, ?> remappingFunction) {
+        return getContextualProperties().compute(key, remappingFunction);
+    }
+
+    @Override
+    public String toString() {
+        return getContextualProperties().toString();
+    }
+
+    @Override
+    public synchronized Object setProperty(String key, String value) {
+        return getContextualProperties().setProperty(key, value);
+    }
+
+    @Override
+    public synchronized void load(Reader reader) throws IOException {
+        getContextualProperties().load(reader);
+    }
+
+    @Override
+    public synchronized void load(InputStream inStream) throws IOException {
+        getContextualProperties().load(inStream);
+    }
+
+    @SuppressWarnings("deprecation")
+	@Override
+    public void save(OutputStream out, String comments) {
+        super.save(out, comments);
+    }
+
+    @Override
+    public void store(Writer writer, String comments) throws IOException {
+        getContextualProperties().store(writer, comments);
+    }
+
+    @Override
+    public void store(OutputStream out, String comments) throws IOException {
+        getContextualProperties().store(out, comments);
+    }
+
+    @Override
+    public void loadFromXML(InputStream in) throws IOException {
+        getContextualProperties().loadFromXML(in);
+    }
+
+    @Override
+    public void storeToXML(OutputStream os, String comment) throws IOException {
+        getContextualProperties().storeToXML(os, comment);
+    }
+
+    @Override
+    public void storeToXML(OutputStream os, String comment, String encoding) throws IOException {
+        getContextualProperties().storeToXML(os, comment, encoding);
+    }
+
+    @Override
+    public void list(PrintStream out) {
+        getContextualProperties().list(out);
+    }
+
+    @Override
+    public void list(PrintWriter out) {
+        getContextualProperties().list(out);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return getContextualProperties().isEmpty();
+    }
+
+    @Override
+    public Object put(Object key, Object value) {
+        return getContextualProperties().put(key, value);
+    }
+
+    @Override
+    public Object remove(Object key) {
+        return getContextualProperties().remove(key);
+    }
+
+    @Override
+    public void putAll(Map<?, ?> t) {
+        getContextualProperties().putAll(t);
+    }
+
+    @Override
+    public void clear() {
+        getContextualProperties().clear();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return getContextualProperties().equals(o);
+    }
+
+    @Override
+    public int hashCode() {
+        return getContextualProperties().hashCode();
+    }
+
+    @Override
+    public void replaceAll(BiFunction<? super Object, ? super Object, ?> function) {
+        getContextualProperties().replaceAll(function);
+    }
+
+    @Override
+    public Object putIfAbsent(Object key, Object value) {
+        return getContextualProperties().putIfAbsent(key, value);
+    }
+
+    @Override
+    public boolean remove(Object key, Object value) {
+        return getContextualProperties().remove(key, value);
+    }
+
+    @Override
+    public boolean replace(Object key, Object oldValue, Object newValue) {
+        return getContextualProperties().replace(key, oldValue, newValue);
+    }
+
+    @Override
+    public Object replace(Object key, Object value) {
+        return getContextualProperties().replace(key, value);
+    }
+
+    @Override
+    public Object merge(Object key, Object value, BiFunction<? super Object, ? super Object, ?> remappingFunction) {
+        return getContextualProperties().merge(key, value, remappingFunction);
+    }
+
+    public Properties getInitialProperties() {
+        return initialProperties;
+    }
+
+    /**
+     * Uninstalls the contextual system properties for the current context, as determined by the current
+     * context provider active.
+     */
+    public static void resetProperties() {
+        String contextId = contextProvider == null ? "" : contextProvider.get();
+        contextualProperties.remove(contextId);
+    }
+
+    protected Properties getContextualProperties() {
+        String contextId = contextProvider == null ? "" : contextProvider.get();
+        Properties props = ConfiguredSystemProperties.contextualProperties.get(contextId);
+        if (props == null) {
+            synchronized (LOCK) {
+                props = ConfiguredSystemProperties.contextualProperties.get(contextId);
+                if (props == null) {
+                    props = createNewProperties();
+                    contextualProperties.put(contextId, props);
+                }
+            }
+        }
+        return props;
+    }
+
+    protected Properties createNewProperties() {
+        Properties props = new Properties(initialProperties);
+        Configuration config = Configuration.current();
+        Map<String, String> configMap = config.getProperties();
+        for (Map.Entry<String, String> en : configMap.entrySet()) {
+            props.put(en.getKey(), en.getValue());
+        }
+        return props;
+    }
+}


Mime
View raw message