You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2016/10/30 17:25:49 UTC

[07/10] incubator-tamaya-sandbox git commit: TAMAYA-182: Adapted modules to new builder patter changes, including tests. Fixed compile errors, or excluded modules from compilation (see root pom).

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/StagedConfigPropertiesProvider.java
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/StagedConfigPropertiesProvider.java b/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/StagedConfigPropertiesProvider.java
deleted file mode 100644
index 722d0d0..0000000
--- a/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/StagedConfigPropertiesProvider.java
+++ /dev/null
@@ -1,137 +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.staged.spi;
-//
-//
-//import org.apache.tamaya.spisupport.MapPropertySource;
-//import org.apache.tamaya.spisupport.PropertiesResourcePropertySource;
-//import org.apache.tamaya.resource.ConfigResources;
-//import org.apache.tamaya.spi.PropertySource;
-//
-//import java.net.URL;
-//import java.util.ArrayList;
-//import java.util.Collection;
-//import java.util.List;
-//import java.util.logging.Logger;
-//
-///**
-// * Configuration provider that resolves to a location in the classpath.
-// * Hereby the following system properties can be set to configure the provider
-// * (all entries are optional):
-// * <pre>
-// *     env.STAGE   :   ordered list of configs to be loaded, e.g. sys-env,GLOBAL,TEST,DEV
-// * </pre>
-// * Adding {@code sys-env} as stage maps the current environment properties using
-// * the priority to be aliged with the context ordering, defined by {@code env.STAGE}.
-// * Similarly the same thing can be done by passing {@code sys-props} as context id for
-// * adding the current System properties to the configuration tree.
-// *
-// * The rootContext can be used to remap the whole property space to an alternate subtree in
-// * the configuration tree overall. This is very handy, if multiple instances of this class
-// * are registered into the same configuration, but with different location setups. Remapping
-// * configuration allows to separate these entries clearly.<br/>
-// * Finally the resource location can be adapted by overriding {@link #getBaseResourcePath()}.
-// * Different formats and loading mechanisms can be implemented by overriding
-// * {@link #loadProperties(String, String, int, List)}.
-// */
-//public class StagedConfigPropertiesProvider extends BaseStagedPropertySourceProvider {
-//
-//    /** The system property to define the stages used. */
-//    private static final String STAGE_PROP = "env.STAGE";
-//    /** The logger used. */
-//
-//    private static final Logger LOGGER = Logger.getLogger(StagedConfigPropertiesProvider.class.getName());
-//
-//    /** The context id for adding the system's environment properties. */
-//    private static final String DEFAULT_ENV = "sys-env";
-//
-//    /** The context id for adding the system's properties. */
-//    private static final String DEFAULT_SYSPROPS = "sys-props";
-//
-//    /**
-//     * Creates a new instance.
-//     * @param rootContext the (optional) root context, can be null.
-//     * @param stages the comma separated list of stages.
-//     */
-//    public StagedConfigPropertiesProvider(String rootContext, String... stages){
-//        super(rootContext, evaluateStages(stages));
-//    }
-//
-//    /**
-//     * Creates a default instance. the stages are read from the {@code env.STAGE} system�propertx
-//     * or a default is applied.
-//     */
-//    public StagedConfigPropertiesProvider(){
-//        super(null, evaluateStages(null));
-//    }
-//
-//    /**
-//     * Evaluates the stages or returns the default STAGE entry.
-//     * @return the stages to be used, never null.
-//     */
-//    private static String[] evaluateStages(String[] stages) {
-//        if(stages!=null && stages.length>0){
-//            return stages.clone();
-//        }
-//        String value = System.getProperty(STAGE_PROP);
-//        if(value==null) {
-//            value = System.getenv(STAGE_PROP);
-//        }
-//        if(value==null){
-//            value = "sys-env,GLOBAL,DEVELOPMENT,sys-props";
-//        }
-//        return value.split(",");
-//    }
-//
-//    @Override
-//    protected Collection<PropertySource> loadStageProperties(
-//            String rootContext, String contextId, int priority) {
-//        List<PropertySource> result = new ArrayList<>();
-//        if (DEFAULT_ENV.equals(contextId)){
-//            result.add(new MapPropertySource(DEFAULT_ENV, System.getenv(),
-//                    rootContext, priority));
-//        }else if (DEFAULT_SYSPROPS.equals(contextId)){
-//            result.add(new MapPropertySource(DEFAULT_SYSPROPS, System.getProperties(),
-//                    rootContext, priority));
-//        }
-//        else{
-//            loadProperties(rootContext, contextId, priority, result);
-//        }
-//        return result;
-//    }
-//
-//    private void loadProperties(String rootContext, String contextId, int priority,
-//                                List<PropertySource> result) {
-//        String cpExp = getBaseResourcePath()+'/' +contextId+".properties";
-//        if(cpExp.startsWith("/")){
-//            cpExp = cpExp.substring(1);
-//        }
-//        for(URL url: ConfigResources.getResourceResolver().getResources(cpExp)){
-//            result.add(new PropertiesResourcePropertySource(rootContext, url, priority));
-//        }
-//    }
-//
-//    /**
-//     * Get the basic resource path used for lookup of properties files.
-//     * @return the basic resource path, never null.
-//     */
-//    protected String getBaseResourcePath() {
-//        return "";
-//    }
-//
-//
-//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/package-info.java
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/package-info.java b/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/package-info.java
deleted file mode 100644
index 9037c2b..0000000
--- a/metamodel-staged/src/main/java/org/apache/tamaya/staged/spi/package-info.java
+++ /dev/null
@@ -1,23 +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.
- */
-/**
- * Main API of the environment module, containing the base class for implementing adapted
- * environment parts in your configuration.
- */
-package org.apache.tamaya.environment.spi;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi b/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
deleted file mode 100644
index 8ef0643..0000000
--- a/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
+++ /dev/null
@@ -1,19 +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 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.dsl.internal.DSLLoadingConfigurationProviderSpi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.staged.spi.DSLPropertySourceProvider
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.staged.spi.DSLPropertySourceProvider b/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.staged.spi.DSLPropertySourceProvider
deleted file mode 100644
index e80367e..0000000
--- a/metamodel-staged/src/main/resources/META-INF/services/org.apache.tamaya.staged.spi.DSLPropertySourceProvider
+++ /dev/null
@@ -1,20 +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 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.dsl.internal.NamedDSLPropertySourceProvider
-org.apache.tamaya.dsl.internal.ResourceDSLPropertySourceProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/test/java/org/apache/tamaya/dsl/ProfileManagerTest.java
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/test/java/org/apache/tamaya/dsl/ProfileManagerTest.java b/metamodel-staged/src/test/java/org/apache/tamaya/dsl/ProfileManagerTest.java
deleted file mode 100644
index 9692d47..0000000
--- a/metamodel-staged/src/test/java/org/apache/tamaya/dsl/ProfileManagerTest.java
+++ /dev/null
@@ -1,78 +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.dsl;
-
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.*;
-
-/**
- * Created by atsticks on 05.05.16.
- */
-public class ProfileManagerTest {
-
-    private ProfileManager profileManager = ProfileManager.getInstance();
-
-    @org.junit.Test
-    public void isProfileActive() throws Exception {
-        assertTrue(profileManager.isProfileActive("DEV"));
-        assertTrue(profileManager.isProfileActive("DEFAULT"));
-        assertFalse(profileManager.isProfileActive("PROD"));
-    }
-
-    @org.junit.Test
-    public void isProfileDefined() throws Exception {
-        assertTrue(profileManager.isProfileDefined("DEV"));
-        assertTrue(profileManager.isProfileDefined("DEFAULT"));
-        assertFalse(profileManager.isProfileDefined("foo"));
-    }
-
-    @org.junit.Test
-    public void isProfileDefault() throws Exception {
-        assertFalse(profileManager.isProfileDefault("DEV"));
-        assertTrue(profileManager.isProfileDefault("DEFAULT"));
-    }
-
-    @org.junit.Test
-    public void getActiveProfiles() throws Exception {
-        List<String> profiles = profileManager.getActiveProfiles();
-        assertTrue(profiles.contains("DEV"));
-        assertTrue(profiles.contains("DEFAULT"));
-        assertFalse(profiles.contains("TEST"));
-        assertFalse(profiles.contains("PROD"));
-    }
-
-    @org.junit.Test
-    public void getDefaultProfiles() throws Exception {
-        List<String> profiles = profileManager.getDefaultProfiles();
-        assertTrue(profiles.contains("DEFAULT"));
-        assertFalse(profiles.contains("TEST"));
-    }
-
-    @org.junit.Test
-    public void getAllProfiles() throws Exception {
-        Set<String> profiles = profileManager.getAllProfiles();
-        assertTrue(profiles.contains("DEFAULT"));
-        assertTrue(profiles.contains("DEV"));
-        assertTrue(profiles.contains("TEST"));
-        assertTrue(profiles.contains("PROD"));
-        assertFalse(profiles.contains("foo"));
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/test/resources/GLOBAL.properties
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/test/resources/GLOBAL.properties b/metamodel-staged/src/test/resources/GLOBAL.properties
deleted file mode 100644
index 9f39f75..0000000
--- a/metamodel-staged/src/test/resources/GLOBAL.properties
+++ /dev/null
@@ -1,19 +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 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.
-#
-aKey=aValue.GLOBAL

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/test/resources/TEST.properties
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/test/resources/TEST.properties b/metamodel-staged/src/test/resources/TEST.properties
deleted file mode 100644
index 2b31cb3..0000000
--- a/metamodel-staged/src/test/resources/TEST.properties
+++ /dev/null
@@ -1,19 +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 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.
-#
-aKey=aValue.TEST

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/test/resources/tamaya-TEST.yaml
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/test/resources/tamaya-TEST.yaml b/metamodel-staged/src/test/resources/tamaya-TEST.yaml
deleted file mode 100644
index 3e56656..0000000
--- a/metamodel-staged/src/test/resources/tamaya-TEST.yaml
+++ /dev/null
@@ -1,27 +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 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.
-#
-tamaya-configuration:
-  includes:
-    tamaya-DEFAULT.yaml
-
-  property-sources:
-    - class: org.apache.tamaya.resources.ResourceProvider
-        resource: classpath:META-INF/config/test/**/*.*"
-    - class: org.apache.tamaya.resources.ResourceProvider
-        resource: classpath://META-INF/config/test/**/*.*"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel-staged/src/test/resources/tamaya-config.yaml
----------------------------------------------------------------------
diff --git a/metamodel-staged/src/test/resources/tamaya-config.yaml b/metamodel-staged/src/test/resources/tamaya-config.yaml
deleted file mode 100644
index a2980f6..0000000
--- a/metamodel-staged/src/test/resources/tamaya-config.yaml
+++ /dev/null
@@ -1,37 +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 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.
-#
-tamaya-config:
-  source-selectors:
-   - DEFAULT:
-       source: tamaya-DEFAULT.yml
-       labels: env=TEST env=PTA env=PROD
-   - TEST:
-       source: tamaya-TEST.yml
-       labels: env=TEST
-   - PTA:
-       source: tamaya-PTA.yml
-       labels: env=PTA
-   - PROD:
-       source: tamaya-PROD.yml
-       labels: env=PROD
-
-  default-labels:  env=DEV
-
-  expressions:
-   - env:    ${sys-property:ENV}, ${env-property:ENV}, "DEV"

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/DSLFormatManager.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/DSLFormatManager.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/DSLFormatManager.java
new file mode 100644
index 0000000..b7c0074
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/DSLFormatManager.java
@@ -0,0 +1,115 @@
+/*
+ * 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.metamodel.dsl;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.format.ConfigurationFormat;
+import org.apache.tamaya.format.ConfigurationFormats;
+import org.apache.tamaya.functions.ConfigurationFunctions;
+
+import java.util.*;
+
+/**
+ * Component that manages the current supported formats:
+ * <pre>
+ * TAMAYA:
+ *   FORMAT-DEF:
+ *     - formats: yaml, properties, xml-properties
+ * </pre>
+ * Hereby:
+ * <ul>
+ *     <li><b>profiles</b> defines the available profiles, including implicit default profiles.</li>
+ * </ul>
+ */
+public final class DSLFormatManager {
+
+    private static final DSLFormatManager INSTANCE = new DSLFormatManager();
+
+    /** The currently active formats, in order of precedence, the most significant are the last ones. */
+    private List<ConfigurationFormat> formats = new ArrayList<>();
+    /** The currently active suffixes, in order of precedence, the most significant are the last ones. */
+    private List<String> suffixes = new ArrayList<>();
+
+
+    /**
+     * Get the current instance.
+     * @return the current profile manager, never null.
+     */
+    public static DSLFormatManager getInstance(){
+        return INSTANCE;
+    }
+
+    private DSLFormatManager(){
+        Configuration metaConfig = MetaConfiguration.getConfiguration();
+        Configuration formatsConfig = metaConfig.with(
+                ConfigurationFunctions.section("TAMAYA.FORMATS"));
+        String[] formats = formatsConfig.getOrDefault("formats","yamk,properties,ini").split(",");
+        this.formats.addAll(ConfigurationFormats.getFormats(formats));
+        String[] suffixes = formatsConfig.getOrDefault("suffixes","yml,properties,ini").split(",");
+        for(String sfx:suffixes){
+            sfx = sfx.trim();
+            if(sfx.isEmpty()){
+                continue;
+            }
+            this.suffixes.add(sfx);
+        }
+    }
+
+
+    /**
+     * Allows to check if a suffix is currently activated.
+     * @param suffix the suffix name, not null.
+     * @return true, if the profile is defined.
+     */
+    public boolean isSuffixDefined(String suffix){
+        return this.suffixes.contains(suffix);
+    }
+
+    /**
+     * Allows to check if a format is selected.
+     * @param formatName the format name, not null.
+     * @return true, if the format is a selected.
+     */
+    public boolean isFormatSelected(String formatName){
+        for(ConfigurationFormat format:formats){
+            if(format.getName().equals(formatName)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Get the list of currently active suffixes.
+     * @return the list of currently active suffixes, never null.
+     */
+    public List<String> getSuffixes(){
+        return Collections.unmodifiableList(suffixes);
+    }
+
+    /**
+     * Get the list of currently active formats.
+     * @return the list of currently active formats, never null.
+     */
+    public List<ConfigurationFormat> getFormats(){
+        return Collections.unmodifiableList(formats);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/MetaConfiguration.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/MetaConfiguration.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/MetaConfiguration.java
new file mode 100644
index 0000000..b3f7da0
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/MetaConfiguration.java
@@ -0,0 +1,142 @@
+/*
+ * 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.metamodel.dsl;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.format.ConfigurationData;
+import org.apache.tamaya.format.ConfigurationFormat;
+import org.apache.tamaya.format.ConfigurationFormats;
+import org.apache.tamaya.json.YAMLFormat;
+import org.apache.tamaya.resource.ConfigResources;
+import org.apache.tamaya.spi.ConfigurationContextBuilder;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Meta environment configuration builder and accessor. Normally this class shoulds never be accessed
+ * by client code. But it could be useful for extensions that extend the meta-configuration capabilities
+ * of tamaya having access to the meta-configuration, so they can read their own meta-entries to
+ * setup whatever features they implement.
+ */
+public final class MetaConfiguration {
+
+    private static final Logger LOGGER = Logger.getLogger(MetaConfiguration.class.getName());
+    private static MetaConfiguration INSTANCE = new MetaConfiguration();
+
+    private Configuration config;
+    private String resourceExpression;
+    private String[] formatNames;
+
+    /**
+     * Initializes the metaconfiguration.
+     * @param resourceExpression the resource expression that defines the resources to load.
+     * @param formatNames the format names to be used.
+     */
+    private void init(String resourceExpression, String... formatNames){
+        if(this.config!=null){
+            LOGGER.warning(">>> Reset of Meta-Configuration resource : " + resourceExpression);
+            LOGGER.warning(">>> Reset of Meta-Configuration formats  : " + Arrays.toString(formatNames));
+        }
+        if(resourceExpression==null){
+            resourceExpression = "tamaya-config.*";
+        }
+        LOGGER.info(">>> Meta-Configuration resource : " + resourceExpression);
+        ConfigurationFormat[] formats = loadFormats(formatNames);
+        ConfigurationContextBuilder builder = ConfigurationProvider.getConfigurationContextBuilder();
+        for(URL url:ConfigResources.getResourceResolver().getResources(resourceExpression)) {
+            for(ConfigurationFormat format:formats) {
+                if(format.accepts(url)){
+                    try(InputStream is = url.openStream()){
+                        ConfigurationData data = format.readConfiguration(url.toString(), is);
+                        builder.addPropertySources(PropertySourceBuilder(
+                                url.toString(), data.getCombinedProperties()));
+                    }catch(Exception e){
+                        LOGGER.log(Level.INFO, "Failed to read " + url + " with format " + format, e);
+                    }
+                }
+            }
+        }
+        this.config = ConfigurationProvider.createConfiguration(builder.build());
+        LOGGER.info("Meta-Configuration read: " + this.config.getProperties().size() + " entries.");
+    }
+
+    private ConfigurationFormat[] loadFormats(String... formatNames) {
+        List<ConfigurationFormat> formats = new ArrayList<>();
+        if(formatNames.length==0) {
+            String metaFormats = System.getProperty("tamaya.meta-formats");
+            if (metaFormats != null) {
+                formatNames = metaFormats.split(",");
+            }
+        }
+        for (String formatName : formatNames) {
+            formats.addAll(ConfigurationFormats.getFormats(formatName));
+        }
+        if(formats.isEmpty()){
+            formats.addAll(ConfigurationFormats.getFormats("yaml"));
+        }
+        if(formats.isEmpty()){
+            formats.add(new YAMLFormat());
+        }
+        LOGGER.info(">>> Meta-Configuration formats  : " + formats);
+        return formats.toArray(new ConfigurationFormat[formats.size()]);
+    }
+
+    /**
+     * Access the system's meta-configuration, initialize if necessary. Normally this class shoulds never be accessed
+     * by client code. But it could be useful for extensions that extend the meta-configuration capabilities
+     * of tamaya having access to the meta-configuration, so they can read their own meta-entries to
+     * setup whatever features they implement.
+     * @return the meta-configuration instance used for setting up the Tamaya's application configuration
+     * model.
+     */
+    public static Configuration getConfiguration(){
+        if(INSTANCE.config==null) {
+            INSTANCE.init(null);
+        }
+        return INSTANCE.config;
+    }
+
+    /**
+     * Access the system's meta-configuration, initialize if necessary. Normally this class shoulds never be accessed
+     * by client code. But it could be useful for extensions that extend the meta-configuration capabilities
+     * of tamaya having access to the meta-configuration, so they can read their own meta-entries to
+     * setup whatever features they implement.
+     *
+     * @param resourceExpression the resource expression that defines where the metaconfiguration
+     *                           files/resources are located.
+     * @param formatNames        the formats supported, if null all formats found are tried for each resource(=URL).
+     * @return the meta-configuration instance used for setting up the Tamaya's application configuration
+     * model.
+     */
+    public static Configuration getConfiguration(String resourceExpression,
+                                                 String... formatNames){
+        if(INSTANCE.config==null) {
+            INSTANCE.init(resourceExpression, formatNames);
+        }
+        return INSTANCE.config;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/ProfileManager.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/ProfileManager.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/ProfileManager.java
new file mode 100644
index 0000000..6e95ffe
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/ProfileManager.java
@@ -0,0 +1,213 @@
+/*
+ * 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.metamodel.dsl;
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.functions.ConfigurationFunctions;
+import org.apache.tamaya.resolver.Resolver;
+import org.apache.tamaya.resolver.spi.ExpressionResolver;
+import org.apache.tamaya.spi.ServiceContextManager;
+
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Component that manages the current setup profiles for this environment/runtime. The profile manager
+ * reads the profile meta configuration that looks as follows:
+ * <pre>
+ * TAMAYA:
+ *   PROFILES-DEF:
+ *     - profiles:          DEFAULTS,DEV,TEST,PTA,PROD
+ *     - defaults:          DEFAULTS
+ *     - default-active:    DEV
+ *     - evaluation:        ${sys:ENV}, ${env:ENV}
+ * </pre>
+ * Hereby:
+ * <ul>
+ *     <li><b>profiles</b> defines the available profiles, including implicit default profiles.</li>
+ *     <li><b>defaults</b> defines the profiles that are loaded implicitly first as defaults.</li>
+ *     <li><b>default-active</b> defines the profile(s) activated by default, when no profile setting could be evaluated.
+ *     <li><b>evaluation</b> defines the resolution expressions to be used to evaluate the current profiles active.
+ *       By default {@code ${sys:ENV}, ${env:ENV}} is used, which tries to evaluate {@code ENV} using system and
+ *       environment properties. Refere to the {@code tamaya-resolver} module for further details on resolvers and
+ *       expressions and see {@link Resolver#evaluateExpression(String, boolean)}.
+ * </ul>
+ */
+public final class ProfileManager {
+
+    private static final Logger LOG = Logger.getLogger(ProfileManager.class.getName());
+    private static final ProfileManager INSTANCE = new ProfileManager();
+
+    /** The currently active profiles, in order of precedence, the most significant are the last ones. */
+    private List<String> activeProfiles = new ArrayList<>();
+    /** A set of all defined profiles. */
+    private Set<String> profiles = new HashSet<>();
+    /** The current used default profiles, loaded initially, before all other profiles are loaded. */
+    private List<String> defaultProfiles = new ArrayList<>();
+
+
+    /**
+     * Get the current instance.
+     * @return the current profile manager, never null.
+     */
+    public static ProfileManager getInstance(){
+        return INSTANCE;
+    }
+
+    private ProfileManager(){
+        Configuration metaConfig = MetaConfiguration.getConfiguration();
+        Configuration profileConfig = metaConfig.with(
+                ConfigurationFunctions.section("TAMAYA.PROFILES-DEF"));
+        String[] selectables = profileConfig.getOrDefault("profiles","DEFAULT,DEV,TEST,PROD").split(",");
+        for(String sel:selectables){
+            sel = sel.trim();
+            if(sel.isEmpty()){
+                continue;
+            }
+            this.profiles.add(sel);
+        }
+        String[] defaults = profileConfig.getOrDefault("defaults","DEFAULT").split(",");
+        for(String def:defaults){
+            def = def.trim();
+            if(def.isEmpty()){
+                continue;
+            }
+            if(!isProfileDefined(def)){
+                throw new ConfigException("Invalid profile encountered: " +def + ", valid are: " + profiles);
+            }
+            this.defaultProfiles.add(def);
+        }
+        String[] expressions = profileConfig.getOrDefault("evaluation","${sys:ENV}, ${env:ENV}").split(",");
+        String currentEnvironment = null;
+        for(String exp:expressions){
+            exp = exp.trim();
+            if(exp.isEmpty()){
+                continue;
+            }
+            currentEnvironment = evaluateExpression(exp);
+            if(currentEnvironment!=null){
+                currentEnvironment = currentEnvironment.trim();
+                if(!currentEnvironment.isEmpty()){
+                    break;
+                }
+            }
+        }
+        if(currentEnvironment==null|| currentEnvironment.isEmpty()){
+            currentEnvironment = profileConfig.getOrDefault("default-active", "DEV");
+        }
+        this.activeProfiles.addAll(defaultProfiles);
+        String[] profilesActive = currentEnvironment.split(",");
+        for(String prof:profilesActive){
+            prof = prof.trim();
+            if(prof.isEmpty()){
+                continue;
+            }
+            if(!isProfileDefined(prof)){
+                throw new ConfigException("Invalid profile encountered: " +prof + ", valid are: " + profiles);
+            }
+            this.activeProfiles.add(prof);
+        }
+    }
+
+    /**
+     * Evaluates the expressions to evaluate the current profile.
+     * Currently the following expressions are supported
+     * <pre>
+     * sys-property:xxx
+     * env-property:xxx
+     * </pre>
+     * {@code xxx} is the corresponding key.
+     * @param currentProfileExpression the profile expression.
+     * @return the evaluated String, or null.
+     */
+    private String evaluateExpression(String currentProfileExpression){
+        currentProfileExpression = currentProfileExpression.trim();
+        List<ExpressionResolver> resolvers = new ArrayList<>();
+        for(ExpressionResolver res: ServiceContextManager.getServiceContext().getServices(ExpressionResolver.class)){
+            resolvers.add(res);
+        }
+        for(ExpressionResolver res:resolvers){
+            if(currentProfileExpression.startsWith(res.getResolverPrefix())){
+                try{
+                    return res.evaluate(currentProfileExpression.substring(res.getResolverPrefix().length()));
+                }catch(Exception e){
+                    LOG.log(Level.FINEST, "Error evaluating resolver: " + res, e);
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Allows to check if a profile is currently active.
+     * @param profileName the profile name, not null.
+     * @return true, if the profile is active.
+     */
+    public boolean isProfileActive(String profileName){
+        return this.activeProfiles.contains(profileName);
+    }
+
+    /**
+     * Allows to check if a profile is currently defined.
+     * @param profileName the profile name, not null.
+     * @return true, if the profile is defined.
+     */
+    public boolean isProfileDefined(String profileName){
+        return this.profiles.contains(profileName);
+    }
+
+    /**
+     * Allows to check if a profile is a default profile.
+     * @param profileName the profile name, not null.
+     * @return true, if the profile is a default profile.
+     */
+    public boolean isProfileDefault(String profileName){
+        return this.defaultProfiles.contains(profileName);
+    }
+
+    /**
+     * Get the list of currently active profiles.
+     * @return the list of currently active profiles, in order of precedence, the most significant
+     * are the last ones, never null.
+     */
+    public List<String> getActiveProfiles(){
+        return Collections.unmodifiableList(activeProfiles);
+    }
+
+    /**
+     * Get the list of currently active profiles.
+     * @return the list of currently active profiles, in order of precedence, the most significant
+     * are the last ones, never null.
+     */
+    public List<String> getDefaultProfiles(){
+        return Collections.unmodifiableList(defaultProfiles);
+    }
+
+    /**
+     * Get the list of currently active profiles.
+     * @return the list of currently active profiles, in order of precedence, the most significant
+     * are the last ones, never null.
+     */
+    public Set<String> getAllProfiles(){
+        return Collections.unmodifiableSet(profiles);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/TamayaConfigurator.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/TamayaConfigurator.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/TamayaConfigurator.java
new file mode 100644
index 0000000..f8abf29
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/TamayaConfigurator.java
@@ -0,0 +1,234 @@
+/*
+ * 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.metamodel.dsl;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.functions.ConfigurationFunctions;
+import org.apache.tamaya.spi.*;
+import org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+/**
+ * Configuration class setting up the Tamaya runtime model.
+ */
+public final class TamayaConfigurator {
+
+    private static final Logger LOGGER = Logger.getLogger(MetaConfiguration.class.getName());
+    private static final Comparator<WrappedPropertySource> ORDINAL_COMPARATOR =
+            new Comparator<WrappedPropertySource>(){
+                @Override
+                public int compare(WrappedPropertySource o1, WrappedPropertySource o2) {
+                    return o1.getOrdinal() - o2.getOrdinal();
+                }
+            };
+
+    private static final TamayaConfigurator INSTANCE = new TamayaConfigurator();
+
+    private ConfigurationContext configurationContext;
+    private Set<String> formats = new HashSet<>();
+    private Set<String> suffixes = new HashSet<>();
+    private Map<String,DSLPropertySourceProvider> dslResolvers = new HashMap<>();
+
+
+    private TamayaConfigurator(){
+        configure(null);
+    }
+
+    /**
+     * Get the singleton instance.
+     * @return the instance, never null.
+     */
+    public static TamayaConfigurator getInstance(){
+        return INSTANCE;
+    }
+
+    /**
+     * Configures the Tamaya runtime using the metamodel configuration found at the default
+     * location.
+     * @see MetaConfiguration
+     */
+    public void configure(){
+        configure(null);
+    }
+
+    /**
+     * Configures the Tamaya runtime using the given resource location expression and (optionally)
+     * formats to be used for evaluating the metamodel configuration.
+     * @param resourceExpression resource expression for resolving the location of the
+     *                           meta configuration.
+     * @param formats the format names to be used, optional, but not null.
+     * @see MetaConfiguration
+     */
+    public void configure(String resourceExpression, String... formats){
+        loadDSLSourceResolvers();
+        Configuration metaConfig = MetaConfiguration.getConfiguration(resourceExpression, formats);
+        Configuration profilesConfig = metaConfig.with(
+                ConfigurationFunctions.section("TAMAYA.PROFILES.", true));
+        Configuration metaProfile = profilesConfig.with(
+                ConfigurationFunctions.section("<COMMON>.", true));
+        System.out.println(metaProfile.getProperties().keySet());
+        String[] values = metaProfile.getOrDefault("formats","yaml, properties, xml-properties").split(",");
+        for(String fmt:values){
+            fmt = fmt.trim();
+            if(fmt.isEmpty()){
+                continue;
+            }
+            this.formats.add(fmt);
+        }
+        values = metaProfile.getOrDefault("suffixes", "yml, yaml, properties, xml").split(",");
+        for(String sfx:values){
+            sfx = sfx.trim();
+            if(sfx.isEmpty()){
+                continue;
+            }
+            this.suffixes.add(sfx);
+        }
+        ConfigurationContextBuilder builder = ConfigurationProvider.getConfigurationContextBuilder();
+        Map<String, PropertySource> loadedPropertySources = loadDefaultPropertySources();
+        int defaultOrdinal = loadSources(builder, "<COMMON>", metaProfile, loadedPropertySources, 0) + 20;
+        // Load current profiles
+        for(String profile:ProfileManager.getInstance().getActiveProfiles()){
+            metaProfile = profilesConfig.with(
+                    ConfigurationFunctions.section(profile, true));
+            defaultOrdinal = loadSources(builder, profile, metaProfile, loadedPropertySources, defaultOrdinal) + 20;
+        }
+        //         formats:  yaml, properties, xml-properties
+        //    - SUFFIX:   yaml, yml, properties, xml
+        //    - sources:
+        //      - "named:env-properties"   # provider name, or class name
+        //      - "named:main-args"
+        //      - "named:sys-properties"
+        //      - "resource:classpath:META-INF/config/**/*.SUFFIX"
+
+    }
+
+    /**
+     * Loads all default registered property sources and providers.
+     * @return the default property sources available on the system.
+     */
+    private Map<String, PropertySource> loadDefaultPropertySources() {
+        Map<String, PropertySource> loadedPropertySources = new HashMap<>();
+        for(PropertySource ps: ServiceContextManager.getServiceContext().getServices(PropertySource.class)){
+            loadedPropertySources.put(ps.getName(), ps);
+        }
+        for(PropertySourceProvider prov: ServiceContextManager.getServiceContext().getServices(PropertySourceProvider.class)){
+            for(PropertySource ps: prov.getPropertySources()){
+                loadedPropertySources.put(ps.getName(), ps);
+            }
+        }
+        return loadedPropertySources;
+    }
+
+    private int loadSources(ConfigurationContextBuilder builder, String profileId, Configuration metaProfile, Map<String,
+            PropertySource> defaultPropertySources, int nextOrdinal) {
+        String[] values;
+        List<PropertySource> propertySourcesLoaded = new ArrayList<>();
+        values = metaProfile.getOrDefault("sources","<default>").split(",");
+        if(values.length==1 && "<default>".equals(values[0])){
+            // load default property sources and providers from config as default.
+            // additional providers may be added depending on the active profile...
+            LOGGER.info("Using default configuration setup for "+profileId);
+            nextOrdinal = addAndGetNextOrdinal(builder, defaultPropertySources.values(),
+                    propertySourcesLoaded, nextOrdinal);
+        }else {
+            LOGGER.info("Loading DSL based "+profileId+" configuration context...");
+            int count = 0;
+            for (String source : values) {
+                source = source.trim();
+                if (source.isEmpty()) {
+                    continue;
+                }
+                String sourceKey = getSourceKey(source);
+                LOGGER.info("Loading "+profileId+" configuration source: " + source);
+                // evaluate DSLSourceResolver and resolve PropertySources, register thm into context
+                // apply newMaxOrdinal...
+                DSLPropertySourceProvider resolver = dslResolvers.get(sourceKey);
+                if(resolver==null){
+                    LOGGER.warning("DSL error: unresolvable source expression: "+ source);
+                    continue;
+                }
+                List<PropertySource> sources = resolver.resolve(source.substring(sourceKey.length()),
+                        defaultPropertySources);
+                nextOrdinal = addAndGetNextOrdinal(builder, sources, propertySourcesLoaded, nextOrdinal);
+            }
+            LOGGER.info("Loaded "+count+" DSL based "+profileId+" configuration contexts.");
+        }
+        return nextOrdinal;
+    }
+
+    private int addAndGetNextOrdinal(ConfigurationContextBuilder builder, Collection<PropertySource> sourcesToAdd,
+                                     List<PropertySource> allPropertySources, int nextOrdinal) {
+        allPropertySources.addAll(wrapOrdinals(nextOrdinal, sourcesToAdd));
+        nextOrdinal = Math.max(calculateHighestOrdinal(allPropertySources)+1, nextOrdinal+1);
+        builder.addPropertySources(allPropertySources);
+        return nextOrdinal;
+    }
+
+    private List<WrappedPropertySource> wrapOrdinals(int nextOrdinal, Collection<PropertySource> propertySources) {
+        List<WrappedPropertySource> result = new ArrayList<>();
+        for(PropertySource ps: propertySources){
+            result.add(WrappedPropertySource.of(ps));
+        }
+        Collections.sort(result, ORDINAL_COMPARATOR);
+        for(WrappedPropertySource ps: result){
+            ps.setOrdinal(nextOrdinal++);
+        }
+        Collections.sort(result, ORDINAL_COMPARATOR);
+        return result;
+    }
+
+    private int calculateHighestOrdinal(Collection<PropertySource> sources) {
+        int maxOrdinal = 0;
+        for (PropertySource ps : sources) {
+            if (ps.getOrdinal() > maxOrdinal) {
+                maxOrdinal = ps.getOrdinal();
+            }
+        }
+        return maxOrdinal;
+    }
+
+    private String getSourceKey(String source) {
+        int index = source.indexOf(':');
+        if(index>0){
+            return source.substring(0,index);
+        }
+        return source;
+    }
+
+    private void loadDSLSourceResolvers() {
+        // Load the ConfigurationDSLSourceResolvers on the system
+        for(DSLPropertySourceProvider res:
+                ServiceContextManager.getServiceContext().getServices(
+                        DSLPropertySourceProvider.class)){
+            this.dslResolvers.put(res.getKey(), res);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/WrappedPropertySource.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/WrappedPropertySource.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/WrappedPropertySource.java
new file mode 100644
index 0000000..7aed843
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/WrappedPropertySource.java
@@ -0,0 +1,100 @@
+/*
+ * 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.metamodel.dsl;
+
+import org.apache.tamaya.spi.PropertySource;
+import org.apache.tamaya.spi.PropertyValue;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Wrapped property source that allows dynamically reassigning the property source's
+ * ordinal value. This is needed for reordering the property sources to
+ * match the DSL configured ordering.
+ */
+final class WrappedPropertySource implements PropertySource {
+
+    private Integer ordinalAssigned;
+    private PropertySource wrapped;
+
+    private WrappedPropertySource(PropertySource wrapped){
+        this.wrapped = Objects.requireNonNull(wrapped);
+    }
+
+    /**
+     * Wraps a given property source.
+     * @param propertySource the property source to be wrapped.
+     * @return a wrapped property source.
+     */
+    public static WrappedPropertySource of(PropertySource propertySource){
+        if(propertySource instanceof WrappedPropertySource){
+            return (WrappedPropertySource)propertySource;
+        }
+        return new WrappedPropertySource(propertySource);
+    }
+
+    @Override
+    public int getOrdinal() {
+        return ordinalAssigned!=null?ordinalAssigned.intValue():wrapped.getOrdinal();
+    }
+
+    /**
+     * Applies the given ordinal to the instance.
+     * @param ordinal the new ordinal.
+     */
+    public void setOrdinal(int ordinal){
+        this.ordinalAssigned = ordinal;
+    }
+
+    /**
+     * Resetting the ordinal to the one of the wrapped property source.
+     */
+    public void resetOrdinal(){
+        this.ordinalAssigned = null;
+    }
+
+    @Override
+    public String getName() {
+        return wrapped.getName();
+    }
+
+    @Override
+    public PropertyValue get(String key) {
+        return wrapped.get(key);
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        return wrapped.getProperties();
+    }
+
+    @Override
+    public boolean isScannable() {
+        return wrapped.isScannable();
+    }
+
+    @Override
+    public String toString() {
+        return "WrappedPropertySource{" +
+                "ordinalAssigned=" + ordinalAssigned +
+                ", wrapped=" + wrapped +
+                '}';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/DSLLoadingConfigurationProviderSpi.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/DSLLoadingConfigurationProviderSpi.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/DSLLoadingConfigurationProviderSpi.java
new file mode 100644
index 0000000..e640e3f
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/DSLLoadingConfigurationProviderSpi.java
@@ -0,0 +1,81 @@
+/*
+ * 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.metamodel.dsl.internal;
+
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.spi.ConfigurationContext;
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.metamodel.dsl.TamayaConfigurator;
+import org.apache.tamaya.spi.ConfigurationContextBuilder;
+import org.apache.tamaya.spi.ConfigurationProviderSpi;
+import org.apache.tamaya.spi.ServiceContextManager;
+
+import javax.annotation.Priority;
+
+/**
+ * ConfigurationContext that uses {@link TamayaConfigurator} to configure the
+ * Tamaya runtime context.
+ */
+@Priority(10)
+public class DSLLoadingConfigurationProviderSpi implements ConfigurationProviderSpi{
+
+    private boolean configured;
+
+    private ConfigurationContext context = ConfigurationProvider.getConfigurationContextBuilder().build();
+    private Configuration config = ConfigurationProvider.createConfiguration(context);
+
+
+    @Override
+    public ConfigurationContextBuilder getConfigurationContextBuilder() {
+        return ServiceContextManager.getServiceContext().getService(ConfigurationContextBuilder.class);
+    }
+
+    @Override
+    public void setConfigurationContext(ConfigurationContext context){
+        // TODO think on a SPI or move event part into API...
+        this.config = ConfigurationProvider.createConfiguration(context);
+        this.context = context;
+    }
+
+    @Override
+    public boolean isConfigurationContextSettable() {
+        return true;
+    }
+
+    @Override
+    public Configuration getConfiguration() {
+        checkInitialized();
+        return config;
+    }
+
+    @Override
+    public ConfigurationContext getConfigurationContext() {
+        checkInitialized();
+        return context;
+    }
+
+    private void checkInitialized() {
+        if(!configured){
+            synchronized (context) {
+                TamayaConfigurator.getInstance().configure();
+                configured = true;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/NamedDSLPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/NamedDSLPropertySourceProvider.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/NamedDSLPropertySourceProvider.java
new file mode 100644
index 0000000..6c50dc1
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/NamedDSLPropertySourceProvider.java
@@ -0,0 +1,53 @@
+/*
+ * 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.metamodel.dsl.internal;
+
+import org.apache.tamaya.spi.PropertySource;
+import org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+/**
+ * DSL provider implementation that allows to use registered {@link PropertySource} instances
+ * by matching {@link PropertySource#getName()} with the configured value and overriding the
+ * {@link PropertySource#getOrdinal()} method.
+ */
+public class NamedDSLPropertySourceProvider implements DSLPropertySourceProvider{
+
+    private static final Logger LOG = Logger.getLogger(NamedDSLPropertySourceProvider.class.getName());
+
+    @Override
+    public List<PropertySource> resolve(String sourceExpression, Map<String, PropertySource> defaultPropertySources) {
+        List<PropertySource> result = new ArrayList<>();
+        PropertySource ps = defaultPropertySources.get(sourceExpression);
+        if(ps==null){
+            LOG.warning("No such property source provider found: " + sourceExpression);
+        }
+        result.add(ps);
+        return result;
+    }
+
+    @Override
+    public String getKey() {
+        return "named:";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/ResourceDSLPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/ResourceDSLPropertySourceProvider.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/ResourceDSLPropertySourceProvider.java
new file mode 100644
index 0000000..f2f2a71
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/internal/ResourceDSLPropertySourceProvider.java
@@ -0,0 +1,82 @@
+/*
+ * 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.metamodel.dsl.internal;
+
+import org.apache.tamaya.metamodel.dsl.DSLFormatManager;
+import org.apache.tamaya.format.ConfigurationData;
+import org.apache.tamaya.format.ConfigurationFormat;
+import org.apache.tamaya.resource.ConfigResources;
+import org.apache.tamaya.spi.PropertySource;
+import org.apache.tamaya.spisupport.MapPropertySource;
+import org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * DSL provider implementation that allows to use registered {@link PropertySource} instances
+ * by matching {@link PropertySource#getName()} with the configured value and overriding the
+ * {@link PropertySource#getOrdinal()} method.
+ */
+public class ResourceDSLPropertySourceProvider implements DSLPropertySourceProvider{
+
+    private static final Logger LOG = Logger.getLogger(ResourceDSLPropertySourceProvider.class.getName());
+
+    @Override
+    public List<PropertySource> resolve(String sourceExpression, Map<String, PropertySource> defaultPropertySources) {
+        List<PropertySource> result = new ArrayList<>();
+        List<URL> resources = new ArrayList<>();
+        if(sourceExpression.contains("SUFFIX")) {
+            for (String suffix : DSLFormatManager.getInstance().getSuffixes()) {
+                Collection<URL> locations = ConfigResources.getResourceResolver().getResources(getClass().getClassLoader(),
+                        sourceExpression.replace("SUFFIX", suffix));
+                loadPropertySources(locations, result);
+            }
+        }else {
+            Collection<URL> locations = ConfigResources.getResourceResolver().getResources(getClass().getClassLoader(),
+                    sourceExpression);
+            loadPropertySources(locations, result);
+        }
+        return result;
+    }
+
+    private void loadPropertySources(Collection<URL> locations, List<PropertySource> result) {
+        for(URL url:locations){
+            for(ConfigurationFormat format: DSLFormatManager.getInstance().getFormats()) {
+                try(InputStream is = url.openStream()){
+                    ConfigurationData data = format.readConfiguration(url.toString(),is);
+                    result.add(new MapPropertySource(url.toString(), data.getCombinedProperties()));
+                }catch(Exception e){
+                    LOG.log(Level.FINEST, "Format failed: " + format.getName() + " for " + url, e);
+                }
+            }
+        }
+    }
+
+    @Override
+    public String getKey() {
+        return "resource:";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/package-info.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/package-info.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/package-info.java
new file mode 100644
index 0000000..c707302
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/dsl/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * Main package of the DSL module. Normally client code does not need access this package.
+ * But extensions also relying on the meta-data configuration mechanism may use it.
+ */
+package org.apache.tamaya.metamodel.dsl;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/BaseStagedPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/BaseStagedPropertySourceProvider.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/BaseStagedPropertySourceProvider.java
new file mode 100644
index 0000000..bba2ec4
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/BaseStagedPropertySourceProvider.java
@@ -0,0 +1,121 @@
+///*
+// * 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.metamodel.spi;
+//
+//
+//import org.apache.tamaya.ConfigException;
+//import org.apache.tamaya.spi.PropertySource;
+//import org.apache.tamaya.spi.PropertySourceProvider;
+//
+//import java.util.ArrayList;
+//import java.util.Arrays;
+//import java.util.Collection;
+//import java.util.List;
+//import java.util.logging.Logger;
+//
+///**
+// * Implements a base property source provider that defines a multilayered
+// * stage setup.
+// */
+//public abstract class BaseStagedPropertySourceProvider implements PropertySourceProvider {
+//
+//    /** The logger used. */
+//    private static final Logger LOGGER = Logger.getLogger(BaseStagedPropertySourceProvider.class.getName());
+//
+//    /** the current environment stages in order of precedence (weakest first). */
+//    private List<String> contextIds = new ArrayList<>();
+//
+//    /** Optional root context of the environment in the config tree. All entries loaded will be mapped into
+//     * this root conztext.
+//     */
+//    private String rootContext;
+//
+//    /** List of PropertySources evaluated and returned to the current ConfigurationContext on load. */
+//    private List<PropertySource> propertySources = new ArrayList<>();
+//
+//
+//    /**
+//     * Creates a new Environment provider, hereby using 10 for basePriority and priorityIncrease.
+//     * @param rootContext the environment target root context, e.g. ENV. or null
+//     *                               for not remapping the environment properties.
+//     * @param contextIds the context ids, that build up the environment.
+//     */
+//    public BaseStagedPropertySourceProvider(String rootContext,
+//                                            String... contextIds) {
+//        this(rootContext, 10,10, contextIds);
+//    }
+//        /**
+//         * Creates a new Environment provider.
+//         * @param rootContext the environment target root context, e.g. ENV. or null
+//         *                               for not remapping the environment properties.
+//         * @param basePriority the base priority used for the weakest environment properties set.
+//         * @param priorityIncrease the value the property source's priority should be increased with each
+//         *                         environment context level added.
+//         * @param contextIds the context ids, that build up the environment.
+//         */
+//    public BaseStagedPropertySourceProvider(String rootContext, int basePriority, int priorityIncrease,
+//                                            String... contextIds) {
+//        if (contextIds.length == 0) {
+//            throw new ConfigException("At least one environment context id must be defined.");
+//        }
+//        if (rootContext == null) {
+//            LOGGER.finest("No environment mapping is applied.");
+//        }
+//        this.rootContext = rootContext;
+//        this.contextIds.addAll(Arrays.asList(contextIds));
+//        int priority = basePriority;
+//        for (String contextId : contextIds) {
+//            propertySources.addAll(loadStageProperties(rootContext, contextId, priority));
+//            priority += priorityIncrease;
+//        }
+//    }
+//
+//    /**
+//     * Method that loads the environment properties for the given contextId.
+//     * @param rootContext the root context, where entries read should be mapped to.
+//     * @param contextId the contextId.
+//     * @param priority  the target priority the created PropertySource should have. This priority is
+//     *                  important, since it reflects the order as defined
+//     *                  when configuring this class. Therefore it should not be overridden normally.
+//     * @return the corresponding PrioritySources to be added, never null.
+//     */
+//    protected abstract Collection<PropertySource> loadStageProperties(
+//            String rootContext, String contextId, int priority);
+//
+//    /**
+//     * Get the environment context ids that define how this environment configuration
+//     * is setup, in order of their increasing priority.
+//     * @return the ordered list of context ids.
+//     */
+//    public List<String> getContextIds() {
+//        return contextIds;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "EnvironmentPropertySourceProvider{" +
+//                "contextIds=" + contextIds +
+//                ", rootContext='" + rootContext + '\'' +
+//                '}';
+//    }
+//
+//    @Override
+//    public Collection<PropertySource> getPropertySources() {
+//        return propertySources;
+//    }
+//
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/DSLPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/DSLPropertySourceProvider.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/DSLPropertySourceProvider.java
new file mode 100644
index 0000000..ea4e653
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/DSLPropertySourceProvider.java
@@ -0,0 +1,51 @@
+/*
+ * 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.metamodel.spi;
+
+import org.apache.tamaya.spi.PropertySource;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Resolver to resolve/map DSL related source expressions into PropertySources
+ * loadable by a ConfigurationContext. Hereby the ordering of loaded property sources must be
+ * honored if possible by implicitly adapting/Overriding the default ordinal for the sources
+ * added.
+ */
+public interface DSLPropertySourceProvider {
+
+    /**
+     * Resolve the given expression (without the key part).
+     * @param sourceExpression the source expression, not null.
+     * @param defaultPropertySources the default property sources that can be used as defined by the functionality by
+     *                               a resolver.
+     * @return the list of loaded Property sources, never null.
+     */
+    List<PropertySource> resolve(String sourceExpression,
+                                 Map<String, PropertySource> defaultPropertySources);
+
+    /**
+     * Get the resolver key, which identifiesan expression to be resolved by a resolver instance.
+     * As an example {@code "named:"} is the key for an expression {@code "named:sys-properties"}.
+     * The method {@link #resolve(String, Map)} will onyl receive the secoind part of the expression.
+     * @return identifying key.
+     */
+    String getKey();
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/StagedConfigPropertiesProvider.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/StagedConfigPropertiesProvider.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/StagedConfigPropertiesProvider.java
new file mode 100644
index 0000000..39c27d3
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/StagedConfigPropertiesProvider.java
@@ -0,0 +1,137 @@
+///*
+// * 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.metamodel.spi;
+//
+//
+//import org.apache.tamaya.spisupport.MapPropertySource;
+//import org.apache.tamaya.spisupport.PropertiesResourcePropertySource;
+//import org.apache.tamaya.resource.ConfigResources;
+//import org.apache.tamaya.spi.PropertySource;
+//
+//import java.net.URL;
+//import java.util.ArrayList;
+//import java.util.Collection;
+//import java.util.List;
+//import java.util.logging.Logger;
+//
+///**
+// * Configuration provider that resolves to a location in the classpath.
+// * Hereby the following system properties can be set to configure the provider
+// * (all entries are optional):
+// * <pre>
+// *     env.STAGE   :   ordered list of configs to be loaded, e.g. sys-env,GLOBAL,TEST,DEV
+// * </pre>
+// * Adding {@code sys-env} as stage maps the current environment properties using
+// * the priority to be aliged with the context ordering, defined by {@code env.STAGE}.
+// * Similarly the same thing can be done by passing {@code sys-props} as context id for
+// * adding the current System properties to the configuration tree.
+// *
+// * The rootContext can be used to remap the whole property space to an alternate subtree in
+// * the configuration tree overall. This is very handy, if multiple instances of this class
+// * are registered into the same configuration, but with different location setups. Remapping
+// * configuration allows to separate these entries clearly.<br/>
+// * Finally the resource location can be adapted by overriding {@link #getBaseResourcePath()}.
+// * Different formats and loading mechanisms can be implemented by overriding
+// * {@link #loadProperties(String, String, int, List)}.
+// */
+//public class StagedConfigPropertiesProvider extends BaseStagedPropertySourceProvider {
+//
+//    /** The system property to define the stages used. */
+//    private static final String STAGE_PROP = "env.STAGE";
+//    /** The logger used. */
+//
+//    private static final Logger LOGGER = Logger.getLogger(StagedConfigPropertiesProvider.class.getName());
+//
+//    /** The context id for adding the system's environment properties. */
+//    private static final String DEFAULT_ENV = "sys-env";
+//
+//    /** The context id for adding the system's properties. */
+//    private static final String DEFAULT_SYSPROPS = "sys-props";
+//
+//    /**
+//     * Creates a new instance.
+//     * @param rootContext the (optional) root context, can be null.
+//     * @param stages the comma separated list of stages.
+//     */
+//    public StagedConfigPropertiesProvider(String rootContext, String... stages){
+//        super(rootContext, evaluateStages(stages));
+//    }
+//
+//    /**
+//     * Creates a default instance. the stages are read from the {@code env.STAGE} system�propertx
+//     * or a default is applied.
+//     */
+//    public StagedConfigPropertiesProvider(){
+//        super(null, evaluateStages(null));
+//    }
+//
+//    /**
+//     * Evaluates the stages or returns the default STAGE entry.
+//     * @return the stages to be used, never null.
+//     */
+//    private static String[] evaluateStages(String[] stages) {
+//        if(stages!=null && stages.length>0){
+//            return stages.clone();
+//        }
+//        String value = System.getProperty(STAGE_PROP);
+//        if(value==null) {
+//            value = System.getenv(STAGE_PROP);
+//        }
+//        if(value==null){
+//            value = "sys-env,GLOBAL,DEVELOPMENT,sys-props";
+//        }
+//        return value.split(",");
+//    }
+//
+//    @Override
+//    protected Collection<PropertySource> loadStageProperties(
+//            String rootContext, String contextId, int priority) {
+//        List<PropertySource> result = new ArrayList<>();
+//        if (DEFAULT_ENV.equals(contextId)){
+//            result.add(new MapPropertySource(DEFAULT_ENV, System.getenv(),
+//                    rootContext, priority));
+//        }else if (DEFAULT_SYSPROPS.equals(contextId)){
+//            result.add(new MapPropertySource(DEFAULT_SYSPROPS, System.getProperties(),
+//                    rootContext, priority));
+//        }
+//        else{
+//            loadProperties(rootContext, contextId, priority, result);
+//        }
+//        return result;
+//    }
+//
+//    private void loadProperties(String rootContext, String contextId, int priority,
+//                                List<PropertySource> result) {
+//        String cpExp = getBaseResourcePath()+'/' +contextId+".properties";
+//        if(cpExp.startsWith("/")){
+//            cpExp = cpExp.substring(1);
+//        }
+//        for(URL url: ConfigResources.getResourceResolver().getResources(cpExp)){
+//            result.add(new PropertiesResourcePropertySource(rootContext, url, priority));
+//        }
+//    }
+//
+//    /**
+//     * Get the basic resource path used for lookup of properties files.
+//     * @return the basic resource path, never null.
+//     */
+//    protected String getBaseResourcePath() {
+//        return "";
+//    }
+//
+//
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/package-info.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/package-info.java b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/package-info.java
new file mode 100644
index 0000000..2f1e606
--- /dev/null
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/spi/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+/**
+ * Main API of the environment module, containing the base class for implementing adapted
+ * environment parts in your configuration.
+ */
+package org.apache.tamaya.metamodel.spi;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider
----------------------------------------------------------------------
diff --git a/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider b/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider
new file mode 100644
index 0000000..f2b1843
--- /dev/null
+++ b/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.metamodel.spi.DSLPropertySourceProvider
@@ -0,0 +1,20 @@
+#
+# 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.metamodel.dsl.internal.NamedDSLPropertySourceProvider
+org.apache.tamaya.metamodel.dsl.internal.ResourceDSLPropertySourceProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi b/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
new file mode 100644
index 0000000..6406156
--- /dev/null
+++ b/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationProviderSpi
@@ -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.metamodel.dsl.internal.DSLLoadingConfigurationProviderSpi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/041f5998/metamodel/src/test/resources/GLOBAL.properties
----------------------------------------------------------------------
diff --git a/metamodel/src/test/resources/GLOBAL.properties b/metamodel/src/test/resources/GLOBAL.properties
new file mode 100644
index 0000000..9f39f75
--- /dev/null
+++ b/metamodel/src/test/resources/GLOBAL.properties
@@ -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.
+#
+aKey=aValue.GLOBAL