tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [7/9] incubator-tamaya git commit: TAMAYA-19: Code cleanup.
Date Sat, 06 Dec 2014 01:03:29 GMT
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/AggregatedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/AggregatedPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/AggregatedPropertyProvider.java
deleted file mode 100644
index 446ef4c..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/AggregatedPropertyProvider.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.*;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-
-import java.util.*;
-
-/**
- * Implementation for a {@link org.apache.tamaya.PropertyProvider} that is an aggregate current
- * multiple child instances. Controlled by an {@link org.apache.tamaya.AggregationPolicy} the
- * following aggregations are supported:
- * <ul>
- * <li><b>IGNORE_DUPLICATES: </b>Ignore all overrides.</li>
- * <li><b>: </b></li>
- * <li><b>: </b></li>
- * <li><b>: </b></li>
- * </ul>
- */
-class AggregatedPropertyProvider extends AbstractPropertyProvider {
-
-    private static final long serialVersionUID = -1419376385695224799L;
-	private AggregationPolicy policy = AggregationPolicy.COMBINE();
-	private List<PropertyProvider> units = new ArrayList<PropertyProvider>();
-    private PropertyProvider mutableProvider;
-
-    /**
-     * Creates a new instance.
-     * @param mutableProvider the provider instance that would be used for delegating
-     *                        change requests.
-     * @param policy
-     *            The aggregation policy to be used.
-     * @param propertyMaps
-     *            The property sets to be included.
-     */
-	public AggregatedPropertyProvider(MetaInfo metaInfo, PropertyProvider mutableProvider, AggregationPolicy policy, List<PropertyProvider> propertyMaps) {
-        super(MetaInfoBuilder.of(metaInfo).setType("aggregated").build());
-        Objects.requireNonNull(policy);
-        this.policy = policy;
-		units.addAll(propertyMaps);
-        this.mutableProvider = mutableProvider;
-	}
-
-	/**
-	 * Get the {@link AggregationPolicy} for this instance.
-	 * 
-	 * @return the {@link AggregationPolicy}, never {@code null}.
-	 */
-	public AggregationPolicy getAggregationPolicy() {
-		return policy;
-	}
-
-	/**
-	 * Return the names current the {@link org.apache.tamaya.PropertyProvider} instances to be
-	 * aggregated in this instance, in the order current precedence (the first are
-	 * the weakest).
-	 * 
-	 * @return the ordered list current aggregated scope identifiers, never
-	 *         {@code null}.
-	 */
-	public List<PropertyProvider> getConfigurationUnits() {
-		return Collections.unmodifiableList(units);
-	}
-
-    /**
-     * Apply a config change to this item. Hereby the change must be related to the same instance.
-     * @param change the config change
-     * @throws org.apache.tamaya.ConfigException if an unrelated change was passed.
-     * @throws UnsupportedOperationException when the configuration is not writable.
-     */
-    @Override
-    public void apply(ConfigChangeSet change){
-        if(mutableProvider!=null)
-            mutableProvider.apply(change);
-        else
-            super.apply(change);
-    }
-
-    @Override
-    public Map<String,String> toMap() {
-		Map<String, String> value = new HashMap<>();
-        for (PropertyProvider unit : units) {
-            for (Map.Entry<String, String> entry : unit.toMap()
-                    .entrySet()) {
-                String valueToAdd = this.policy.aggregate(entry.getKey(), value.get(entry.getKey()), entry.getValue());
-                if(valueToAdd==null){
-                    value.remove(entry.getKey());
-                }
-                else{
-                    value.put(entry.getKey(), valueToAdd);
-                }
-            }
-        }
-        return value;
-	}
-
-    @Override
-	public ConfigChangeSet load() {
-		for (PropertyProvider unit : units) {
-			unit.load();
-		}
-        return super.load();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/ConfigurationInvocationHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/ConfigurationInvocationHandler.java b/core/src/main/java/org/apache/tamaya/core/internal/ConfigurationInvocationHandler.java
deleted file mode 100644
index 6747a78..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/ConfigurationInvocationHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.core.internal.inject.ConfiguredType;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.Objects;
-
-/**
- * Created by Anatole on 17.10.2014.
- */
-class ConfigurationInvocationHandler implements InvocationHandler {
-
-    private Configuration config;
-    private ConfiguredType type;
-
-    public ConfigurationInvocationHandler(Class<?> type, Configuration config) {
-        this.config = Objects.requireNonNull(config);
-        this.type = new ConfiguredType(Objects.requireNonNull(type));
-        if(!type.isInterface()){
-            throw new IllegalArgumentException("Can only proxy interfaces as configuration templates.");
-        }
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        if("toString".equals(method.getName())){
-            return "Configured Proxy -> " + this.type.getType().getName();
-        }
-        return this.type.getConfiguredValue(method, args);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/ContextualPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/ContextualPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/ContextualPropertyProvider.java
deleted file mode 100644
index 5a8bf12..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/ContextualPropertyProvider.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.*;
-
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Supplier;
-
-/**
- * Created by Anatole on 12.04.2014.
- */
-class ContextualPropertyProvider implements PropertyProvider{
-
-    private volatile Map<String,PropertyProvider> cachedMaps = new ConcurrentHashMap<>();
-
-    private Supplier<PropertyProvider> mapSupplier;
-    private Supplier<String> isolationKeySupplier;
-    private MetaInfo metaInfo;
-
-    /**
-     * Creates a new contextual PropertyMap. Contextual maps delegate to different instances current PropertyMap depending
-     * on the keys returned fromMap the isolationP
-     *
-     * @param mapSupplier
-     * @param isolationKeySupplier
-     */
-    public ContextualPropertyProvider(Supplier<PropertyProvider> mapSupplier, Supplier<String> isolationKeySupplier){
-        this.metaInfo = MetaInfoBuilder.of().setType("contextual").set("mapSupplier", mapSupplier.toString())
-                      .set("isolationKeySupplier", isolationKeySupplier.toString()).build();
-        Objects.requireNonNull(mapSupplier);
-        Objects.requireNonNull(isolationKeySupplier);
-        this.mapSupplier = mapSupplier;
-        this.isolationKeySupplier = isolationKeySupplier;
-    }
-
-    /**
-     * This method provides the contextual Map for the current environment. Hereby, ba default, for each different
-     * key returned by the #isolationKeySupplier a separate PropertyMap instance is acquired fromMap the #mapSupplier.
-     * If the map supplier returns an instance it is cached in the local #cachedMaps.
-     *
-     * @return the current contextual PropertyMap.
-     */
-    protected PropertyProvider getContextualMap(){
-        String environmentKey = this.isolationKeySupplier.get();
-        if(environmentKey == null){
-            return PropertyProviders.empty();
-        }
-        PropertyProvider map = this.cachedMaps.get(environmentKey);
-        if(map == null){
-            synchronized(cachedMaps){
-                map = this.cachedMaps.get(environmentKey);
-                if(map == null){
-                    map = this.mapSupplier.get();
-                    if(map == null){
-                        return PropertyProviders
-                                .empty(MetaInfoBuilder.of().setInfo(
-                                        "No map provided by supplier " + mapSupplier + " for key " + environmentKey)
-                                                  .build());
-                    }
-                    this.cachedMaps.put(environmentKey, map);
-                }
-            }
-        }
-        return map;
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        return getContextualMap().load();
-    }
-
-    @Override
-    public boolean containsKey(String key){
-        return getContextualMap().containsKey(key);
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        return getContextualMap().toMap();
-    }
-
-    @Override
-    public MetaInfo getMetaInfo(){
-        return this.metaInfo;
-    }
-
-    @Override
-    public Optional<String> get(String key){
-        return getContextualMap().get(key);
-    }
-
-    @Override
-    public Set<String> keySet(){
-        return getContextualMap().keySet();
-    }
-
-    /**
-     * Apply a config change to this item. Hereby the change must be related to the same instance.
-     * @param change the config change
-     * @throws org.apache.tamaya.ConfigException if an unrelated change was passed.
-     * @throws UnsupportedOperationException when the configuration is not writable.
-     */
-    @Override
-    public void apply(ConfigChangeSet change){
-        getContextualMap().apply(change);
-    }
-
-    /**
-     * Access a cached PropertyMap.
-     *
-     * @param key the target environment key as returned by the environment key supplier, not null.
-     * @return the corresponding PropertyMap, or null.
-     */
-    public PropertyProvider getCachedMap(String key){
-        return this.cachedMaps.get(key);
-    }
-
-    /**
-     * Access the set current currently loaded/cached maps.
-     *
-     * @return the set current cached map keys, never null.
-     */
-    public Set<String> getCachedMapKeys(){
-        return this.cachedMaps.keySet();
-    }
-
-    /**
-     * Access the supplier for environment key, determining map isolation.
-     *
-     * @return the environment key supplier instance, not null.
-     */
-    public Supplier<String> getIsolationKeySupplier(){
-        return this.isolationKeySupplier;
-    }
-
-    /**
-     * Access the supplier for new PropertyMap instances.
-     *
-     * @return the PropertyMap supplier instance, not null.
-     */
-    public Supplier<PropertyProvider> getMapSupplier(){
-        return this.mapSupplier;
-    }
-
-    @Override
-    public String toString(){
-        return "ContextualMap{" +
-                "cachedMaps(key)=" + cachedMaps.keySet() +
-                ", mapSupplier=" + mapSupplier +
-                ", isolationKeySupplier=" + isolationKeySupplier +
-                '}';
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationManagerSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationManagerSingletonSpi.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationManagerSingletonSpi.java
deleted file mode 100644
index 094fb26..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationManagerSingletonSpi.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.core.internal.inject.ConfigurationInjector;
-import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
-import org.apache.tamaya.core.spi.ExpressionEvaluator;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.spi.Bootstrap;
-import org.apache.tamaya.spi.ConfigurationManagerSingletonSpi;
-
-import java.beans.PropertyChangeListener;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Proxy;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.ConcurrentHashMap;
-
-
-public class DefaultConfigurationManagerSingletonSpi implements ConfigurationManagerSingletonSpi {
-
-    private Map<String, ConfigurationProviderSpi> configProviders = new ConcurrentHashMap<>();
-
-    private ExpressionEvaluator expressionEvaluator = loadEvaluator();
-
-    private ExpressionEvaluator loadEvaluator() {
-        ExpressionEvaluator eval = Bootstrap.getService(ExpressionEvaluator.class, null);
-        if (eval == null) {
-            eval = new DefaultExpressionEvaluator();
-        }
-        return eval;
-    }
-
-    public DefaultConfigurationManagerSingletonSpi() {
-        for (ConfigurationProviderSpi spi : Bootstrap.getServices(ConfigurationProviderSpi.class)) {
-            configProviders.put(spi.getConfigName(), spi);
-        }
-    }
-
-    @Override
-    public <T> T getConfiguration(String name, Class<T> type) {
-        ConfigurationProviderSpi provider = configProviders.get(name);
-        if (provider == null) {
-            throw new ConfigException("No such config: " + name);
-        }
-        Configuration config = provider.getConfiguration();
-        if (config == null) {
-            throw new ConfigException("No such config: " + name);
-        }
-        if (Configuration.class.equals(type)) {
-            return (T) config;
-        }
-        return createAdapterProxy(config, type);
-    }
-
-    /**
-     * Creates a proxy implementing the given target interface.
-     *
-     * @param config the configuration to be used for providing values.
-     * @param type   the target interface.
-     * @param <T>    the target interface type.
-     * @return the corresponding implementing proxy, never null.
-     */
-    private <T> T createAdapterProxy(Configuration config, Class<T> type) {
-        ClassLoader cl = Optional.ofNullable(Thread.currentThread()
-                .getContextClassLoader()).orElse(getClass().getClassLoader());
-        return (T)Proxy.newProxyInstance(cl,new Class[]{type}, new ConfigurationInvocationHandler(type, config));
-    }
-
-    @Override
-    public void configure(Object instance) {
-        ConfigurationInjector.configure(instance);
-    }
-
-    private String getConfigId(Annotation... qualifiers) {
-        if (qualifiers == null || qualifiers.length == 0) {
-            return "";
-        }
-        StringBuilder b = new StringBuilder();
-        for (Annotation annot : qualifiers) {
-            b.append('[');
-            b.append(annot.annotationType().getName());
-            b.append(':');
-            b.append(annot.toString());
-            b.append(']');
-        }
-        return b.toString();
-    }
-
-    @Override
-    public String evaluateValue(Configuration config, String expression) {
-        return expressionEvaluator.evaluate(expression);
-    }
-
-    @Override
-    public void addPropertyChangeListener(PropertyChangeListener listener) {
-        Configuration.current().addPropertyChangeListener(listener);
-    }
-
-    @Override
-    public void removePropertyChangeListener(PropertyChangeListener listener) {
-        Configuration.current().removePropertyChangeListener(listener);
-    }
-
-    @Override
-    public boolean isConfigurationDefined(String name) {
-        ConfigurationProviderSpi spi = this.configProviders.get(name);
-        return spi != null;
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultExpressionEvaluator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultExpressionEvaluator.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultExpressionEvaluator.java
deleted file mode 100644
index 4438615..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultExpressionEvaluator.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.spi.Bootstrap;
-import org.apache.tamaya.core.spi.ExpressionEvaluator;
-import org.apache.tamaya.core.spi.ExpressionResolver;
-
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Created by Anatole on 28.09.2014.
- */
-final class DefaultExpressionEvaluator implements ExpressionEvaluator{
-
-    private Map<String, ExpressionResolver> resolvers = new ConcurrentHashMap<>();
-
-    private ExpressionResolver defaultResolver;
-
-    public DefaultExpressionEvaluator() {
-        for(ExpressionResolver resolver: Bootstrap.getServices(ExpressionResolver.class)){
-            resolvers.put(resolver.getResolverId(), resolver);
-        }
-        defaultResolver = Bootstrap.getService(ExpressionResolver.class);
-    }
-
-    /**
-     * Resolves an expression in the form current <code>${resolverId:expression}</code>. The expression can be
-     * part current any type current literal text. Also multiple expression, with different resolver ids are supported.
-     * All control characters (${}\) can be escaped.<br>
-     * So all the following are valid expressions:
-     * <ul>
-     * <li><code>${resolverId:expression}</code></li>
-     * <li><code>bla bla ${resolverId:expression}</code></li>
-     * <li><code>${resolverId:expression} bla bla</code></li>
-     * <li><code>bla bla ${resolverId:expression} bla bla</code></li>
-     * <li><code>${resolverId:expression}${resolverId2:expression2}</code></li>
-     * <li><code>foo ${resolverId:expression}${resolverId2:expression2}</code></li>
-     * <li><code>foo ${resolverId:expression} bar ${resolverId2:expression2}</code></li>
-     * <li><code>${resolverId:expression}foo${resolverId2:expression2}bar</code></li>
-     * <li><code>foor${resolverId:expression}bar${resolverId2:expression2}more</code></li>
-     * <li><code>\${resolverId:expression}foo${resolverId2:expression2}bar</code> (first expression is escaped).</li>
-     * </ul>
-     *
-     * @param expression the expression to be evaluated, not null
-     * @return the evaluated expression.
-     * @throws org.apache.tamaya.ConfigException if resolution fails.
-     */
-    @Override
-    public String evaluate(String expression) {
-        StringTokenizer tokenizer = new StringTokenizer(expression, "${}\\", true);
-        boolean escaped = false;
-        StringBuilder resolvedValue = new StringBuilder();
-        StringBuilder current = new StringBuilder();
-        while (tokenizer.hasMoreTokens()) {
-            String token = tokenizer.nextToken();
-            if (escaped) {
-                switch (token) {
-                    case "n":
-                        current.append("\n");
-                        break;
-                    case "r":
-                        current.append("\r");
-                        break;
-                    case "t":
-                        current.append("\t");
-                        break;
-                    default:
-                        current.append(token);
-                        break;
-                }
-                escaped = false;
-                continue;
-            }
-            switch (token) {
-                case "\\":
-                    escaped = true;
-                    break;
-                case "$":
-                    if (current.length() > 0) {
-                        resolvedValue.append(current);
-                        current.setLength(0);
-                    }
-                    if (!"{".equals(tokenizer.nextToken())) {
-                        throw new ConfigException("Invalid expression encountered: " + expression);
-                    }
-                    String subExpression = tokenizer.nextToken();
-                    if (!"}".equals(tokenizer.nextToken())) {
-                        throw new ConfigException("Invalid expression encountered: " + expression);
-                    }
-                    // evalute subexpression
-                    current.append(evaluteInternal(subExpression));
-                    break;
-                default:
-                    current.append(token);
-            }
-        }
-        if (current.length() > 0) {
-            resolvedValue.append(current);
-        }
-        return resolvedValue.toString();
-    }
-
-    private String evaluteInternal(String subExpression) {
-        int sepPos = subExpression.indexOf(':');
-        if (sepPos > 0) {
-            String refID = subExpression.substring(0, sepPos);
-            String expression = subExpression.substring(sepPos + 1);
-            return Optional.ofNullable(this.resolvers.get(refID)).orElseThrow(
-                    () -> new ConfigException("Resolver not found: " + refID + " in " + subExpression)
-            ).resolve(expression);
-        } else {
-            return Optional.ofNullable(this.defaultResolver).orElseThrow(
-                    () -> new ConfigException("No default Resolver set, but required by " + subExpression)
-            ).resolve(subExpression);
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyAdaptersSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyAdaptersSingletonSpi.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyAdaptersSingletonSpi.java
deleted file mode 100644
index 539465d..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyAdaptersSingletonSpi.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.PropertyAdapter;
-import org.apache.tamaya.annot.WithPropertyAdapter;
-import org.apache.tamaya.spi.PropertyAdaptersSingletonSpi;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.ZoneId;
-import java.util.Currency;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Created by Anatole on 30.09.2014.
- */
-public class DefaultPropertyAdaptersSingletonSpi implements PropertyAdaptersSingletonSpi{
-
-    private Map<Class,PropertyAdapter> adapters = new ConcurrentHashMap<>();
-
-    public DefaultPropertyAdaptersSingletonSpi(){
-        // Add default adapters
-        register(char.class, (s) -> s.charAt(0));
-        register(int.class, Integer::parseInt);
-        register(byte.class, Byte::parseByte);
-        register(short.class, Short::parseShort);
-        register(boolean.class, Boolean::parseBoolean);
-        register(float.class, Float::parseFloat);
-        register(double.class, Double::parseDouble);
-
-        register(Character.class, (s) -> s.charAt(0));
-        register(Integer.class, Integer::parseInt);
-        register(Byte.class, Byte::parseByte);
-        register(Short.class, Short::parseShort);
-        register(Boolean.class, Boolean::parseBoolean);
-        register(Float.class, Float::parseFloat);
-        register(Double.class, Double::parseDouble);
-        register(BigDecimal.class, BigDecimal::new);
-        register(BigInteger.class, BigInteger::new);
-
-        register(Currency.class, (s) -> Currency.getInstance(s));
-
-        register(LocalDate.class, LocalDate::parse);
-        register(LocalTime.class, LocalTime::parse);
-        register(LocalDateTime.class, LocalDateTime::parse);
-        register(ZoneId.class, ZoneId::of);
-    }
-
-    @Override
-    public <T> PropertyAdapter<T> register(Class<T> targetType, PropertyAdapter<T> adapter){
-        return adapters.put(targetType, adapter);
-    }
-
-    @Override
-    public <T> PropertyAdapter<T> getAdapter(Class<T> targetType, WithPropertyAdapter adapterAnnot){
-        PropertyAdapter adapter = null;
-        Class<? extends PropertyAdapter> configuredAdapter = null;
-        if(adapterAnnot != null){
-            configuredAdapter = adapterAnnot.value();
-            if(!configuredAdapter.equals(PropertyAdapter.class)){
-                try{
-                    adapter = configuredAdapter.newInstance();
-                }
-                catch(Exception e){
-                    throw new ConfigException("Invalid adapter configured.", e);
-                }
-            }
-        }
-        if(adapter == null){
-            adapter = adapters.get(targetType);
-        }
-        return adapter;
-    }
-
-    @Override
-    public boolean isTargetTypeSupported(Class<?> targetType){
-        return adapters.containsKey(targetType);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyProvidersSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyProvidersSingletonSpi.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyProvidersSingletonSpi.java
deleted file mode 100644
index 79e2124..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultPropertyProvidersSingletonSpi.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.AggregationPolicy;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProvider;
-import org.apache.tamaya.spi.PropertyProvidersSingletonSpi;
-
-import java.net.URI;
-import java.time.Instant;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
-import java.util.function.Supplier;
-import java.util.logging.Logger;
-
-/**
- * Default implementation current the singleton backing bean for the {@link org.apache.tamaya.PropertyProviders}.
- */
-public class DefaultPropertyProvidersSingletonSpi implements PropertyProvidersSingletonSpi {
-
-    private final PropertyProvider EMPTY_PROPERTYPROVIDER = fromMap(MetaInfo.of("<empty>"), Collections.emptyMap());
-    private static final PropertyProvider ENV_PROPERTYPROVIDER = new EnvironmentPropertyProvider();
-
-    private static final Logger LOG = Logger.getLogger(DefaultPropertyProvidersSingletonSpi.class.getName());
-
-    @Override
-    public PropertyProvider fromArgs(MetaInfo metaInfo, String... args) {
-        if(metaInfo==null){
-            metaInfo = MetaInfo.of("CLI");
-        }
-        // TODO read the CLI with some better library, e.g. move parsing service to ext. service SPI
-        Map<String, String> properties = new HashMap<>();
-        for (int base = 0; base < args.length; base++) {
-            if (args[base].startsWith("--")) {
-                String argKey = args[base].substring(2);
-                String value = "true"; // flag only
-                if (base != args.length - 1) {
-                    if (args[base + 1].startsWith("-")) {
-                        base++;
-                        int eqIndex = argKey.indexOf('=');
-                        if (eqIndex > 0) {
-                            value = argKey.substring(eqIndex + 1);
-                            argKey = argKey.substring(0, eqIndex);
-                        }
-                    } else {
-                        value = args[base + 1];
-                        base += 2;
-                    }
-                }
-                properties.put(argKey, value);
-            } else if (args[base].startsWith("-")) {
-                String argKey = args[base].substring(1);
-                String value = "true"; // flag only
-                if (base != args.length - 1) {
-                    if (args[base + 1].startsWith("-")) {
-                        base++;
-                        int eqIndex = argKey.indexOf('=');
-                        if (eqIndex > 0) {
-                            value = argKey.substring(eqIndex + 1);
-                            argKey = argKey.substring(0, eqIndex);
-                        }
-                    } else {
-                        value = args[base + 1];
-                        base += 2;
-                    }
-                }
-                properties.put(argKey, value);
-            }
-        }
-        return fromMap(metaInfo, properties);
-    }
-
-    @Override
-    public PropertyProvider fromPaths(AggregationPolicy aggregationPolicy, MetaInfo metaInfo, List<String> paths) {
-        if(metaInfo == null){
-            metaInfo = MetaInfoBuilder.of().setInfo("From Paths").set("paths", paths.toString()).build();
-        }
-        return new PathBasedPropertyProvider(metaInfo, paths, aggregationPolicy);
-    }
-
-    @Override
-    public PropertyProvider fromUris(AggregationPolicy aggregationPolicy, MetaInfo metaInfo, List<URI> uris) {
-        if(metaInfo == null){
-            metaInfo = MetaInfoBuilder.of().setInfo("From URIs").set("uris", uris.toString()).build();
-        }
-        return new URIBasedPropertyProvider(metaInfo, uris, aggregationPolicy);
-    }
-
-    @Override
-    public PropertyProvider fromMap(MetaInfo metaInfo, Map<String, String> map) {
-        if(metaInfo == null){
-            metaInfo = MetaInfoBuilder.of().setInfo("From Map").set("map", map.toString()).build();
-        }
-        return new MapBasedPropertyProvider(metaInfo, map);
-    }
-
-    @Override
-    public PropertyProvider empty(MetaInfo metaInfo) {
-        if(metaInfo==null) {
-            return EMPTY_PROPERTYPROVIDER;
-        }
-        return fromMap(metaInfo, Collections.emptyMap());
-    }
-
-    @Override
-    public PropertyProvider emptyMutable(MetaInfo metaInfo) {
-        return fromMap(metaInfo, new ConcurrentHashMap<>());
-    }
-
-    /**
-     * Returns a read-only {@link PropertyProvider} reflecting the current runtime environment properties.
-     *
-     * @return a new read-only {@link PropertyProvider} instance based on the current runtime environment properties.
-     */
-    @Override
-    public PropertyProvider fromEnvironmentProperties() {
-        return ENV_PROPERTYPROVIDER;
-    }
-
-    /**
-     * Creates a new read-only {@link PropertyProvider} reflecting the current system properties.
-     *
-     * @return a new read-only {@link PropertyProvider} instance based on the current system properties.
-     */
-    @Override
-    public PropertyProvider fromSystemProperties() {
-        return new SystemPropertiesPropertyProvider();
-    }
-
-    @Override
-    public PropertyProvider freezed(MetaInfo metaInfo, PropertyProvider provider) {
-        if(metaInfo==null){
-            metaInfo = MetaInfoBuilder.of().setType("freezed")
-                    .set("provider", provider.toString())
-                    .set("freezedAt", Date.from(Instant.now()).toString())
-                    .build();
-        }
-        else{
-            metaInfo = MetaInfoBuilder.of(metaInfo).setType("freezed")
-                    .set("freezedAt", Date.from(Instant.now()).toString())
-                    .set("provider", provider.toString())
-                    .build();
-        }
-        return FreezedPropertyProvider.of(metaInfo, provider);
-    }
-
-    /**
-     * Creates a new {@link PropertyProvider} containing all property maps given, hereby using the given AggregationPolicy.
-     *
-     * @param policy       the AggregationPolicy to be used, not null.
-     * @param providers the maps to be included, not null.
-     * @return the aggregated instance containing all given maps.
-     */
-    @Override
-    public PropertyProvider aggregate(AggregationPolicy policy, MetaInfo metaInfo, List<PropertyProvider> providers) {
-        if(metaInfo==null){
-            metaInfo = MetaInfoBuilder.of().setInfo("Aggregated")
-                    .set("AggregationPolicy", policy.toString())
-                    .set("providers", providers.toString())
-                    .build();
-        }
-        return new AggregatedPropertyProvider(metaInfo, null, policy, providers);
-    }
-
-    /**
-     * Creates a new {@link PropertyProvider} that is mutable by adding a map based instance that overrides
-     * values fromMap the original map.
-     * @param provider the provider to be made mutable, not null.
-     * @return the mutable instance.
-     */
-    @Override
-    public PropertyProvider mutable(MetaInfo metaInfo, PropertyProvider provider) {
-        if(metaInfo==null){
-            metaInfo = MetaInfoBuilder.of(provider.getMetaInfo())
-                    .set("mutableSince", Date.from(Instant.now()).toString())
-                    .build();
-        }
-        PropertyProvider mutableProvider = emptyMutable(metaInfo);
-        List<PropertyProvider> providers = new ArrayList<>(2);
-        providers.add(provider);
-        providers.add(mutableProvider);
-        return new AggregatedPropertyProvider(metaInfo, mutableProvider, AggregationPolicy.OVERRIDE(), providers);
-    }
-
-    /**
-     * Creates a new {@link PropertyProvider} containing only properties that are shared by all given maps,
-     * hereby later maps in the array override  properties fromMap previous instances.
-     * @param aggregationPolicy the policy to resolve aggregation conflicts.
-     * @param providers the maps to be included, not null.
-     * @return the intersecting instance containing all given maps.
-     */
-    @Override
-    public PropertyProvider intersected(AggregationPolicy aggregationPolicy, List<PropertyProvider> providers) {
-        return new IntersectingPropertyProvider(aggregationPolicy, providers);
-    }
-
-    /**
-     * Creates a new {@link PropertyProvider} containing only properties fromMap the target instance, that are not contained
-     * in one current the other maps passed.
-     *
-     * @param target         the base map, not null.
-     * @param subtrahendSets the maps to be subtracted, not null.
-     * @return the intersecting instance containing all given maps.
-     */
-    @Override
-    public PropertyProvider subtracted(PropertyProvider target, List<PropertyProvider> subtrahendSets) {
-        return new SubtractingPropertyProvider(target, subtrahendSets);
-    }
-
-
-    /**
-     * Creates a filtered {@link PropertyProvider} (a view) current a given base {@link }PropertyMap}. The filter hereby is
-     * applied dynamically on access, so also runtime changes current the base map are reflected appropriately.
-     *
-     * @param propertyMap the base map instance, not null.
-     * @param filter      the filtger to be applied, not null.
-     * @return the new filtering instance.
-     */
-    @Override
-    public PropertyProvider filtered(Predicate<String> filter, PropertyProvider propertyMap) {
-        return new FilteredPropertyProvider(propertyMap, filter);
-    }
-
-    /**
-     * Creates a new contextual {@link PropertyProvider}. Contextual maps delegate to different instances current PropertyMap depending
-     * on the keys returned fromMap the isolationP
-     *
-     * @param mapSupplier          the supplier creating new provider instances
-     * @param isolationKeySupplier the supplier providing contextual keys based on the current environment.
-     */
-    @Override
-    public PropertyProvider contextual(Supplier<PropertyProvider> mapSupplier,
-                                              Supplier<String> isolationKeySupplier) {
-        return new ContextualPropertyProvider(mapSupplier, isolationKeySupplier);
-    }
-
-
-    /**
-     * Creates a filtered {@link PropertyProvider} (a view) current a given base {@link }PropertyMap}. The filter hereby is
-     * applied dynamically on access, so also runtime changes current the base map are reflected appropriately.
-     *
-     * @param mainMap   the main map instance, not null.
-     * @param parentMap the delegated parent map instance, not null.
-     * @return the new delegating instance.
-     */
-    @Override
-    public PropertyProvider delegating(PropertyProvider mainMap, Map<String, String> parentMap) {
-        return new DelegatingPropertyProvider(mainMap, parentMap);
-    }
-
-    /**
-     * Creates a {@link org.apache.tamaya.PropertyProvider} where all keys current a current map,
-     * existing in another map are replaced
-     * with the ones fromMap the other {@link org.apache.tamaya.PropertyProvider}. The filter hereby is
-     * applied dynamically on access, so also runtime changes current the base map are reflected appropriately.
-     * Keys not existing in the {@code mainMap}, but present in {@code replacementMao} will be hidden.
-     *
-     * @param mainMap        the main map instance, which keys, present in {@code replacementMap} will be replaced
-     *                       with the ones
-     *                       in {@code replacementMap}, not null.
-     * @param replacementMap the map instance, that will replace all corresponding entries in {@code mainMap}, not null.
-     * @return the new delegating instance.
-     */
-    @Override
-    public PropertyProvider replacing(PropertyProvider mainMap, Map<String, String> replacementMap) {
-        return new ReplacingPropertyProvider(mainMap, replacementMap);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultStage.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultStage.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultStage.java
deleted file mode 100644
index a771b1b..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultStage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.Stage;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Simple default implementation current a stage.
- * Created by Anatole on 12.11.2014.
- */
-final class DefaultStage implements Stage, Serializable{
-    /** The stage's name. */
-    private final String name;
-    /** The stage's properites. */
-    private final Map<String,String> properties;
-
-    /**
-     * Creates a new stage.
-     * @param name the name, not null.
-     * @param properties the properties, not null.
-     */
-    DefaultStage(String name, Map<String,String> properties){
-        this.name = Objects.requireNonNull(name);
-        Map<String,String> tempProps = new HashMap<>(properties);
-        tempProps = Collections.unmodifiableMap(properties);
-        this.properties = tempProps;
-    }
-
-    /**
-     * Get the stage's name.
-     * @return the stage's name, never null.
-     */
-    @Override
-    public String getName(){
-        return name;
-    }
-
-    /**
-     * Get all the stage's (unmodifiable) properties.
-     * @return the stage's (unmodifiable) properties, never null.
-     */
-    @Override
-    public Map<String,String> getProperties(){
-        return properties;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DefaultStagesSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DefaultStagesSingletonSpi.java b/core/src/main/java/org/apache/tamaya/core/internal/DefaultStagesSingletonSpi.java
deleted file mode 100644
index 22289b1..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DefaultStagesSingletonSpi.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.Stage;
-import org.apache.tamaya.spi.StagesSingletonSpi;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Created by Anatole on 12.11.2014.
- */
-public class DefaultStagesSingletonSpi implements StagesSingletonSpi{
-
-
-    public DefaultStagesSingletonSpi(){
-        addStage(StageBuilder.create("Development").build());
-        addStage(StageBuilder.create("Test").build());
-        addStage(StageBuilder.create("Integration").build());
-        addStage(StageBuilder.create("Staging").build());
-        addStage(StageBuilder.create("Production").build());
-    }
-
-    /**
-     * All the stages known.
-     */
-    private static final Map<String, Stage> stages = new ConcurrentHashMap<>();
-
-    @Override
-    public Stage getDevelopmentStage() {
-        return getStage("Development");
-    }
-
-    @Override
-    public Stage getTestStage() {
-        return getStage("Test");
-    }
-
-    @Override
-    public Stage getIntegrationStage() {
-        return getStage("Integration");
-    }
-
-    @Override
-    public Stage getStagingStage() {
-        return getStage("Staging");
-    }
-
-    @Override
-    public Stage getProductionStage() {
-        return getStage("Production");
-    }
-
-    /**
-     * Get a stage by name. If not present, create a new stage.
-     *
-     * @param name the stage's name.
-     * @return tge stage instance, never null.
-     */
-    public Stage getStage(String name) {
-        Stage stage = stages.get(name);
-        if (stage == null) {
-            throw new IllegalArgumentException("No such state: " + name);
-        }
-        return stage;
-    }
-
-    /**
-     * Adds a new stage.
-     *
-     * @param stage the new stage instance.
-     * @throws IllegalStateException if a stage with the same name is already existing.
-     */
-    public void addStage(Stage stage) {
-        Stage existing = stages.putIfAbsent(stage.getName(), stage);
-        if (existing != null) {
-            throw new IllegalStateException("A stage named '" + stage.getName() + "' already exists: " + existing);
-        }
-    }
-
-    /**
-     * Access all the stages currently defined.
-     *
-     * @return the current stages, never null.
-     */
-    public Collection<Stage> getStages() {
-        return stages.values();
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/DelegatingPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/DelegatingPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/DelegatingPropertyProvider.java
deleted file mode 100644
index 75933a3..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/DelegatingPropertyProvider.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProvider;
-
-import java.util.*;
-
-/**
- * Implementation for a {@link org.apache.tamaya.PropertyProvider} that is an aggregate current
- * multiple child instances. Controlled by an {@link org.apache.tamaya.AggregationPolicy} the
- * following aggregations are supported:
- * <ul>
- * <li><b>IGNORE_DUPLICATES: </b>Ignore all overrides.</li>
- * <li><b>: </b></li>
- * <li><b>: </b></li>
- * <li><b>: </b></li>
- * </ul>
- */
-class DelegatingPropertyProvider implements PropertyProvider{
-
-    private static final long serialVersionUID = -1419376385695224799L;
-    private PropertyProvider mainMap;
-    private Map<String,String> parentMap;
-    private MetaInfo metaInfo;
-
-    /**
-     * Creates a mew instance, with aggregation polilcy
-     * {@code AggregationPolicy.OVERRIDE}.
-     *
-     * @param mainMap   The main ConfigMap.
-     * @param parentMap The delegated parent ConfigMap.
-     */
-    public DelegatingPropertyProvider(PropertyProvider mainMap, Map<String,String> parentMap){
-        this.metaInfo =
-                MetaInfoBuilder.of().setType("delegate").set("provider", mainMap.toString()).set("delegate", parentMap.toString())
-                        .build();
-        Objects.requireNonNull(parentMap);
-        this.parentMap = parentMap;
-        Objects.requireNonNull(parentMap);
-        this.parentMap = parentMap;
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        return mainMap.load();
-    }
-
-    @Override
-    public boolean containsKey(String key){
-        return keySet().contains(key);
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        return null;
-    }
-
-    @Override
-    public MetaInfo getMetaInfo(){
-        return this.metaInfo;
-    }
-
-    @Override
-    public Optional<String> get(String key){
-        Optional<String> val = mainMap.get(key);
-        if(!val.isPresent()){
-            return Optional.ofNullable(parentMap.get(key));
-        }
-        return val;
-    }
-
-    @Override
-    public Set<String> keySet(){
-        Set<String> keys = new HashSet<>(mainMap.keySet());
-        keys.addAll(parentMap.keySet());
-        return keys;
-    }
-
-    @Override
-    public String toString(){
-        return super.toString() + "(mainMap=" + mainMap + ", delegate=" + parentMap + ")";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/EnvironmentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/EnvironmentPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/EnvironmentPropertyProvider.java
deleted file mode 100644
index 2a4064b..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/EnvironmentPropertyProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-
-import java.util.Map;
-
-class EnvironmentPropertyProvider extends AbstractPropertyProvider {
-
-    private static final long serialVersionUID = 4753258482658331010L;
-
-    public Map<String,String> toMap(){
-        return System.getenv();
-    }
-
-    public EnvironmentPropertyProvider(){
-        super(MetaInfoBuilder.of().setType("env-properties").build());
-    }
-
-    @Override
-    public String toString(){
-        return "EnvironmentPropertyMap{" +
-                "props=" + super.toString() +
-                '}';
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/FilteredPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/FilteredPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/FilteredPropertyProvider.java
deleted file mode 100644
index cd83c1d..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/FilteredPropertyProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProvider;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.function.Predicate;
-
-class FilteredPropertyProvider extends AbstractPropertyProvider {
-
-    private static final long serialVersionUID = 4301042530074932562L;
-    private PropertyProvider unit;
-    private Predicate<String> filter;
-
-    public FilteredPropertyProvider(PropertyProvider configuration, Predicate<String> filter){
-        super(MetaInfoBuilder.of(configuration.getMetaInfo()).setType("filtered").set("filter", filter.toString()).build());
-        Objects.requireNonNull(configuration);
-        this.unit = configuration;
-        this.filter = filter;
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        final Map<String,String> result = new HashMap<>();
-        this.unit.toMap().entrySet().forEach(e -> {
-            if(filter.test(e.getKey())){
-                result.put(e.getKey(), e.getValue());
-            }
-        });
-        return result;
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        unit.load();
-        return super.load();
-    }
-
-    /**
-     * Apply a config change to this item. Hereby the change must be related to the same instance.
-     * @param change the config change
-     * @throws org.apache.tamaya.ConfigException if an unrelated change was passed.
-     * @throws UnsupportedOperationException when the configuration is not writable.
-     */
-    @Override
-    public void apply(ConfigChangeSet change){
-        this.unit.apply(change);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/FreezedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/FreezedPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/FreezedPropertyProvider.java
deleted file mode 100644
index c7ec244..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/FreezedPropertyProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProvider;
-
-import java.io.Serializable;
-import java.time.Instant;
-import java.util.*;
-
-/**
- * This class models a freezed instance current an {@link org.apache.tamaya.PropertyProvider}.
- * Created by Anatole on 28.03.14.
- */
-final class FreezedPropertyProvider implements PropertyProvider, Serializable{
-
-    private static final long serialVersionUID = 3365413090311267088L;
-    private Map<String,Map<String,String>> fieldMMetaInfo = new HashMap<>();
-    private MetaInfo metaInfo;
-    private Map<String,String> properties = new HashMap<>();
-
-    private FreezedPropertyProvider(MetaInfo metaInfo, PropertyProvider propertyMap) {
-        Map<String, String> map = propertyMap.toMap();
-        this.properties.putAll(map);
-        this.properties = Collections.unmodifiableMap(this.properties);
-        if (metaInfo == null) {
-            this.metaInfo =
-                    MetaInfoBuilder.of(propertyMap.getMetaInfo()).set("freezedAt", Instant.now().toString()).build();
-        } else {
-            this.metaInfo = metaInfo;
-        }
-    }
-
-    public static PropertyProvider of(MetaInfo metaInfo, PropertyProvider propertyProvider){
-        if(propertyProvider instanceof FreezedPropertyProvider){
-            return propertyProvider;
-        }
-        return new FreezedPropertyProvider(metaInfo, propertyProvider);
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        return ConfigChangeSet.emptyChangeSet(this);
-    }
-
-    public int size(){
-        return properties.size();
-    }
-
-    public boolean isEmpty(){
-        return properties.isEmpty();
-    }
-
-    @Override
-    public boolean containsKey(String key){
-        return properties.containsKey(key);
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        return Collections.unmodifiableMap(this.properties);
-    }
-
-    @Override
-    public MetaInfo getMetaInfo(){
-        return this.metaInfo;
-    }
-
-    @Override
-    public Optional<String> get(String key){
-        return Optional.ofNullable(properties.get(key));
-    }
-
-    @Override
-    public Set<String> keySet(){
-        return properties.keySet();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/IntersectingPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/IntersectingPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/IntersectingPropertyProvider.java
deleted file mode 100644
index 2e82d3c..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/IntersectingPropertyProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.*;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * Provider implementation that combines multiple other providers by intersecting
- * the key/values common to all providers, conflicting keys are resolved using an
- * {@link org.apache.tamaya.AggregationPolicy}.
- */
-class IntersectingPropertyProvider extends AbstractPropertyProvider {
-
-    private List<PropertyProvider> providers;
-    private PropertyProvider aggregatedDelegate;
-
-    public IntersectingPropertyProvider(AggregationPolicy policy, List<PropertyProvider> providers) {
-        super(MetaInfoBuilder.of().setType("intersection").build());
-        this.providers = new ArrayList<>(providers);
-        aggregatedDelegate = PropertyProviders.aggregate(policy, this.providers);
-    }
-
-    public IntersectingPropertyProvider(MetaInfo metaInfo, AggregationPolicy policy, PropertyProvider... providers) {
-        super(metaInfo);
-        this.providers = Arrays.asList(Objects.requireNonNull(providers));
-        aggregatedDelegate = PropertyProviders.aggregate(policy, providers);
-    }
-
-
-    @Override
-    public Optional<String> get(String key) {
-        if (containsKey(key))
-            return aggregatedDelegate.get(key);
-        return Optional.empty();
-    }
-
-    private boolean filter(Map.Entry<String, String> entry) {
-        return containsKey(entry.getKey());
-    }
-
-    @Override
-    public boolean containsKey(String key) {
-        for (PropertyProvider prov : this.providers) {
-            if (!prov.containsKey(key)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public Map<String, String> toMap() {
-        return aggregatedDelegate.toMap().entrySet().stream().filter(en -> containsKey(en.getKey())).collect(
-                Collectors.toConcurrentMap(en -> en.getKey(), en -> en.getValue()));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/MapBasedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/MapBasedPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/MapBasedPropertyProvider.java
deleted file mode 100644
index d782353..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/MapBasedPropertyProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-
-import java.beans.PropertyChangeEvent;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Logger;
-
-/**
- * Models a {@link org.apache.tamaya.PropertyProvider} that can be build using a builder pattern.
- */
-class MapBasedPropertyProvider extends AbstractPropertyProvider {
-
-    private static final long serialVersionUID = 7601389831472839249L;
-
-    private static final Logger LOG = Logger.getLogger(MapBasedPropertyProvider.class.getName());
-    /**
-     * The unit's entries.
-     */
-    private Map<String,String> entries = new ConcurrentHashMap<>();
-
-    /**
-     * Constructor used by {@link org.apache.tamaya.core.properties.MapBasedPropertyProviderBuilder}, or subclasses.
-     *
-     * @param entries the config entries, not null.
-     */
-    MapBasedPropertyProvider(MetaInfo metaInfo, Map<String,String> entries){
-        super(metaInfo);
-        Objects.requireNonNull(entries, "entries required.");
-        this.entries.putAll(entries);
-    }
-
-
-    /**
-     * Constructor used by {@link org.apache.tamaya.core.properties.MapBasedPropertyProviderBuilder}, or subclasses.
-     *
-     * @param entries the entries
-     * @param sources the sources
-     * @param errors  the errors
-     */
-    MapBasedPropertyProvider(MetaInfo metaInfo, Map<String,String> entries, Set<String> sources,
-                             Collection<Throwable> errors){
-        super(metaInfo);
-        Objects.requireNonNull(entries, "entries required.");
-        this.entries.putAll(entries);
-        addSources(sources);
-    }
-
-    MapBasedPropertyProvider(MetaInfo metaInfo, Set<String> sources){
-        super(metaInfo);
-        addSources(sources);
-    }
-
-    @Override
-    public Map<String, String> toMap() {
-        return new HashMap<>(this.entries);
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        // Can not reload...
-        return ConfigChangeSet.emptyChangeSet(this);
-    }
-
-    /**
-     * Apply a config change to this item. Hereby the change must be related to the same instance.
-     * @param change the config change
-     * @throws org.apache.tamaya.ConfigException if an unrelated change was passed.
-     * @throws UnsupportedOperationException when the configuration is not writable.
-     */
-    @Override
-    public void apply(ConfigChangeSet change){
-        change.getEvents().forEach(this::applyChange);
-    }
-
-    private void applyChange(PropertyChangeEvent propertyChangeEvent) {
-        LOG.finest(() -> "Applying change to map provider: " + propertyChangeEvent);
-        if(propertyChangeEvent.getNewValue()==null){
-            this.entries.remove(propertyChangeEvent.getPropertyName());
-        }
-        else{
-            this.entries.put(propertyChangeEvent.getPropertyName(), propertyChangeEvent.getNewValue().toString());
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/MapConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/MapConfiguration.java b/core/src/main/java/org/apache/tamaya/core/internal/MapConfiguration.java
deleted file mode 100644
index 07b1f69..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/MapConfiguration.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.PropertyAdapters;
-import org.apache.tamaya.PropertyProvider;
-
-import java.beans.PropertyChangeListener;
-import java.util.*;
-
-/**
- * Configuration based on a simple Map.
- */
-class MapConfiguration implements Configuration, PropertyProvider {
-
-    private Map<String,String> data = new HashMap<>();
-    private MetaInfo metaInfo;
-    private String version = UUID.randomUUID().toString();
-
-    public MapConfiguration(MetaInfo metaInfo, Map<String,String> data){
-        Objects.requireNonNull(metaInfo);
-        Objects.requireNonNull(data);
-        this.metaInfo = metaInfo;
-        this.data.putAll(data);
-        this.data = Collections.unmodifiableMap(this.data);
-    }
-
-    @Override
-    public String getVersion() {
-        return version;
-    }
-
-//    @Override
-//    public <T> T getOrDefault(String key, Class<T> type, T defaultValue){
-//        String value = get(key);
-//        if(value==null){
-//            return defaultValue;
-//        }
-//        return PropertyAdapters.getAdapter(type).adapt(get(key));
-//    }
-
-    @Override
-    public <T> Optional<T> get(String key, Class<T> type){
-        Optional<String> value = get(key);
-        if(value.isPresent()){
-            return Optional.ofNullable(PropertyAdapters.getAdapter(type).adapt(value.get()));
-        }
-        return Optional.empty();
-//        throw new ConfigException("No such config value: " + key + " in " +  getMetaInfo());
-    }
-
-    @Override
-    public Set<String> getAreas(){
-        final Set<String> areas = new HashSet<>();
-        this.keySet().forEach(s -> {
-            int index = s.lastIndexOf('.');
-            if(index > 0){
-                areas.add(s.substring(0, index));
-            }
-            else{
-                areas.add("<root>");
-            }
-        });
-        return areas;
-    }
-
-    @Override
-    public void addPropertyChangeListener(PropertyChangeListener l){
-        // TODO
-    }
-
-    @Override
-    public void removePropertyChangeListener(PropertyChangeListener l){
-        // TODO
-    }
-
-    @Override
-    public boolean containsKey(String key){
-        return data.containsKey(key);
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        return Collections.unmodifiableMap(data);
-    }
-
-    @Override
-    public MetaInfo getMetaInfo(){
-        return this.metaInfo;
-    }
-
-    @Override
-    public Optional<String> get(String key){
-        return Optional.ofNullable(data.get(key));
-    }
-
-    @Override
-    public Set<String> keySet(){
-        return data.keySet();
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/MetaConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/MetaConfig.java b/core/src/main/java/org/apache/tamaya/core/internal/MetaConfig.java
index 1c8b07d..9ad862c 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/MetaConfig.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/MetaConfig.java
@@ -19,12 +19,12 @@
 package org.apache.tamaya.core.internal;
 
 import org.apache.tamaya.core.config.ConfigurationFormats;
+import org.apache.tamaya.core.resource.Resource;
 import org.apache.tamaya.spi.Bootstrap;
 import org.apache.tamaya.core.spi.ConfigurationFormat;
-import org.apache.tamaya.core.spi.ResourceLoader;
+import org.apache.tamaya.core.resource.ResourceLoader;
 
 
-import java.net.URI;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -45,16 +45,16 @@ public final class MetaConfig {
     private Map<String,String> properties = new HashMap<>();
 
     private MetaConfig(){
-        List<URI> propertyUris = Bootstrap.getService(ResourceLoader.class).getResources(MetaConfig.class.getClassLoader(),
-                "classpath*:META-INF/config.properties");
-        for(URI uri:propertyUris){
+        List<Resource> resources = Bootstrap.getService(ResourceLoader.class).getResources(MetaConfig.class.getClassLoader(),
+                "classpath:META-INF/config.properties");
+        for(Resource res:resources){
             try{
-                ConfigurationFormat format = ConfigurationFormats.getFormat(uri);
-                Map<String,String> read = format.readConfiguration(uri);
+                ConfigurationFormat format = ConfigurationFormats.getFormat(res);
+                Map<String,String> read = format.readConfiguration(res);
                 properties.putAll(read);
             }
             catch(Exception e){
-                LOG.log(Level.SEVERE, e, () -> "Error reading meta configuration fromMap " + uri);
+                LOG.log(Level.SEVERE, e, () -> "Error reading meta configuration fromMap " + res);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/PathBasedPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/PathBasedPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/PathBasedPropertyProvider.java
deleted file mode 100644
index 9289608..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/PathBasedPropertyProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.*;
-import org.apache.tamaya.core.config.ConfigurationFormats;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-import org.apache.tamaya.spi.Bootstrap;
-import org.apache.tamaya.core.spi.ConfigurationFormat;
-import org.apache.tamaya.core.spi.ResourceLoader;
-
-import java.net.URI;
-import java.util.*;
-
-/**
- * Created by Anatole on 16.10.2014.
- */
-final class PathBasedPropertyProvider extends AbstractPropertyProvider {
-
-    private List<String> paths = new ArrayList<>();
-    private Map<String, String> properties = new HashMap<>();
-    private AggregationPolicy aggregationPolicy;
-
-    public PathBasedPropertyProvider(MetaInfo metaInfo, Collection<String> paths, AggregationPolicy aggregationPolicy) {
-        super(metaInfo);
-        this.paths.addAll(Objects.requireNonNull(paths));
-        this.aggregationPolicy = Objects.requireNonNull(aggregationPolicy);
-        init();
-    }
-
-    @Override
-    public Map<String, String> toMap() {
-        return this.properties;
-    }
-
-    private void init() {
-        List<String> sources = new ArrayList<>();
-        List<String> effectivePaths = new ArrayList<>();
-        paths.forEach((path) -> {
-            effectivePaths.add(path);
-            for (URI uri : Bootstrap.getService(ResourceLoader.class).getResources(path)) {
-                ConfigurationFormat format = ConfigurationFormats.getFormat(uri);
-                if (format != null) {
-                    try {
-                        Map<String, String> read = format.readConfiguration(uri);
-                        sources.add(uri.toString());
-                        read.forEach((k, v) -> {
-                            String valueToAdd = aggregationPolicy.aggregate(k,properties.get(k),v);
-                            if(valueToAdd==null) {
-                                properties.remove(k);
-                            }
-                            else{
-                                properties.put(k, valueToAdd);
-                            }
-                        });
-                    }
-                    catch(ConfigException e){
-                        throw e;
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        });
-        metaInfo = MetaInfoBuilder.of(getMetaInfo())
-                .setSourceExpressions(new String[effectivePaths.size()])
-                .set("sources", sources.toString()).build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/ReplacingPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/ReplacingPropertyProvider.java b/core/src/main/java/org/apache/tamaya/core/internal/ReplacingPropertyProvider.java
deleted file mode 100644
index 8133046..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/ReplacingPropertyProvider.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProvider;
-
-import java.util.*;
-
-/**
- * Implementation for a {@link org.apache.tamaya.PropertyProvider} that is an aggregate current
- * multiple child instances, where all existing key/values in a replacementMap will
- * replace values in a main map, if present there.
- */
-class ReplacingPropertyProvider implements PropertyProvider{
-
-    private static final long serialVersionUID = -1419376385695224799L;
-    private PropertyProvider mainMap;
-    private Map<String,String> replacingMap;
-    private MetaInfo metaInfo;
-
-    /**
-     * Creates a mew instance, with aggregation polilcy
-     * {@code AggregationPolicy.OVERRIDE}.
-     *
-     * @param mainMap      The main ConfigMap.
-     * @param replacingMap The replacing ConfigMap.
-     */
-    public ReplacingPropertyProvider(PropertyProvider mainMap, Map<String,String> replacingMap){
-        Objects.requireNonNull(replacingMap);
-        this.replacingMap = replacingMap;
-        Objects.requireNonNull(mainMap);
-        this.mainMap = mainMap;
-        this.metaInfo = MetaInfoBuilder.of().setType("replacing").set("mainProvider", mainMap.toString())
-                .set("replacing", replacingMap.toString()).build();
-    }
-
-    @Override
-    public ConfigChangeSet load(){
-        return mainMap.load();
-    }
-
-    @Override
-    public boolean containsKey(String key){
-        return mainMap.containsKey(key);
-    }
-
-    @Override
-    public Map<String,String> toMap(){
-        Map<String,String> result = new HashMap<>(replacingMap);
-        for(Map.Entry<String,String> en : mainMap.toMap().entrySet()){
-            if(!replacingMap.containsKey(en.getKey())){
-                result.put(en.getKey(), en.getValue());
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public MetaInfo getMetaInfo(){
-        return this.metaInfo;
-    }
-
-    @Override
-    public Optional<String> get(String key){
-        String val = replacingMap.get(key);
-        if(val == null){
-            return mainMap.get(key);
-        }
-        return Optional.ofNullable(val);
-    }
-
-    @Override
-    public Set<String> keySet(){
-        return mainMap.keySet();
-    }
-
-    /**
-     * Apply a config change to this item. Hereby the change must be related to the same instance.
-     * @param change the config change
-     * @throws org.apache.tamaya.ConfigException if an unrelated change was passed.
-     * @throws UnsupportedOperationException when the configuration is not writable.
-     */
-    @Override
-    public void apply(ConfigChangeSet change){
-        this.mainMap.apply(change);
-    }
-
-    @Override
-    public String toString(){
-        return super.toString() + "(mainMap=" + mainMap + ", replacingMap=" + replacingMap + ")";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0eef8f37/core/src/main/java/org/apache/tamaya/core/internal/StageBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/StageBuilder.java b/core/src/main/java/org/apache/tamaya/core/internal/StageBuilder.java
deleted file mode 100644
index 2e61c5e..0000000
--- a/core/src/main/java/org/apache/tamaya/core/internal/StageBuilder.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.core.internal;
-
-import org.apache.tamaya.Stage;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Builder for creating new stages. Instances current this class are not thread safe.
- * Created by Anatole on 12.11.2014.
- */
-public final class StageBuilder {
-
-    private String name;
-    private Map<String,String> properties = new HashMap<>();
-
-    /**
-     * Constructor.
-     * @param name the required stage's name, not null.
-     */
-    private StageBuilder(String name){
-        this.name = Objects.requireNonNull(name);
-    }
-
-    /**
-     * Creates a new builder instance.
-     * @param name the stage's name, not null.
-     * @return the new builder, never null.
-     */
-    public static StageBuilder create(String name){
-        return new StageBuilder(name);
-    }
-
-    /**
-     * Adds all the given properties to the stage, existing properties, will be replaced.
-     * @param properties the properties, not null.
-     * @return the builder for chaining.
-     */
-    public StageBuilder setProperties(Map<String,String> properties){
-        this.properties.putAll(properties);
-        return this;
-    }
-
-    /**
-     * Sets a property for the stage, any existing property value will be overriden.
-     * @param key the property key, not null.
-     * @param value the property value, not null.
-     * @return the builder for chaining.
-     */
-    public StageBuilder setProperty(String key, String value){
-        this.properties.put(key, value);
-        return this;
-    }
-
-    /**
-     * Creates a new Stage instance.
-     * @return a new Stage, never null.
-     */
-    public Stage build(){
-        return new DefaultStage(name, properties);
-    }
-}


Mime
View raw message