tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [1/2] incubator-tamaya git commit: TAMAYA-19: Code cleanup - renamed annotation, fixed bugs. Removed unused/useless code including tests.
Date Sun, 07 Dec 2014 01:28:39 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master a32cac85f -> 5c36d32dc


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/properties/ClasspathPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/properties/ClasspathPropertyProvider.java
b/core/src/main/java/org/apache/tamaya/core/internal/properties/ClasspathPropertyProvider.java
index dc71c1a..f6aa4f6 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/properties/ClasspathPropertyProvider.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/properties/ClasspathPropertyProvider.java
@@ -1,150 +1,150 @@
-/*
- * 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.properties;
-
-import org.apache.tamaya.ConfigChangeSet;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.core.properties.AbstractPropertyProvider;
-import org.apache.tamaya.core.properties.ClasspathModulePropertyProvider;
-
-import java.util.*;
-
-public class ClasspathPropertyProvider extends AbstractPropertyProvider {
-
-    private static final long serialVersionUID = -2193109047946712701L;
-    private Map<ClassLoader,ClasspathModulePropertyProvider> configs = new HashMap<>();
-	private String[] resources;
-
-	public ClasspathPropertyProvider(MetaInfo metaInfo, String... resources) {
-        super(metaInfo);
-        Objects.requireNonNull(resources);
-        this.resources = resources;
-	}
-
-
-    @Override
-    public Map<String,String> toMap(){
-        return new Map<String,String>(){
-
-            @Override
-            public int size(){
-                return getLoaderDependentDelegate().size();
-            }
-
-            @Override
-            public boolean isEmpty(){
-                return getLoaderDependentDelegate().isEmpty();
-            }
-
-            @Override
-            public boolean containsKey(Object key){
-                return getLoaderDependentDelegate().containsKey(key);
-            }
-
-            @Override
-            public boolean containsValue(Object value){
-                return getLoaderDependentDelegate().containsValue(value);
-            }
-
-            @Override
-            public String get(Object key){
-                return getLoaderDependentDelegate().get(key);
-            }
-
-            @Override
-            public String put(String key, String value){
-                return getLoaderDependentDelegate().put(key,value);
-            }
-
-            @Override
-            public String remove(Object key){
-                return getLoaderDependentDelegate().remove(key);
-            }
-
-            @Override
-            public void putAll(Map<? extends String,? extends String> m){
-                getLoaderDependentDelegate().putAll(m);
-            }
-
-            @Override
-            public void clear(){
-                getLoaderDependentDelegate().clear();
-            }
-
-            @Override
-            public Set<String> keySet(){
-                return getLoaderDependentDelegate().keySet();
-            }
-
-            @Override
-            public Collection<String> values(){
-                return getLoaderDependentDelegate().values();
-            }
-
-            @Override
-            public Set<Entry<String,String>> entrySet(){
-                return getLoaderDependentDelegate().entrySet();
-            }
-
-        };
-    }
-
-	private Map<String, String> getLoaderDependentDelegate() {
-		Map<String, String> props = new HashMap<>();
-		ClassLoader cl = Thread.currentThread().getContextClassLoader();
-		if (cl == null) {
-			cl = getClass().getClassLoader();
-		}
-		while (cl != null) {
-			ClasspathModulePropertyProvider cfg = this.configs.get(cl);
-			if (cfg == null) {
-				cfg = new ClasspathModulePropertyProvider(cl, this.resources);
-				this.configs.put(cl, cfg);
-			}
-			props.putAll(cfg.toMap());
-			cl = cl.getParent();
-		}
-		return props;
-	}
-
-	@Override
-	public ConfigChangeSet load() {
-		Map<String, String> props = new HashMap<>();
-		ClassLoader cl = Thread.currentThread().getContextClassLoader();
-		if (cl == null) {
-			cl = getClass().getClassLoader();
-		}
-		while (cl != null) {
-			ClasspathModulePropertyProvider cfg = this.configs.get(cl);
-			if (cfg != null) {
-				cfg.load();
-			}
-			cl = cl.getParent();
-		}
-        return super.load();
-	}
-
-    @Override
-    public String toString(){
-        return "ClasspathPropertyProvider{" +
-                "configs=" + configs +
-                ", resources=" + Arrays.toString(resources) +
-                '}';
-    }
-}
+///*
+// * 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.properties;
+//
+//import org.apache.tamaya.ConfigChangeSet;
+//import org.apache.tamaya.MetaInfo;
+//import org.apache.tamaya.core.properties.AbstractPropertyProvider;
+//import org.apache.tamaya.core.properties.ClasspathModulePropertyProvider;
+//
+//import java.util.*;
+//
+//public class ClasspathPropertyProvider extends AbstractPropertyProvider {
+//
+//    private static final long serialVersionUID = -2193109047946712701L;
+//    private Map<ClassLoader,ClasspathModulePropertyProvider> configs = new HashMap<>();
+//	private String[] resources;
+//
+//	public ClasspathPropertyProvider(MetaInfo metaInfo, String... resources) {
+//        super(metaInfo);
+//        Objects.requireNonNull(resources);
+//        this.resources = resources;
+//	}
+//
+//
+//    @Override
+//    public Map<String,String> toMap(){
+//        return new Map<String,String>(){
+//
+//            @Override
+//            public int size(){
+//                return getLoaderDependentDelegate().size();
+//            }
+//
+//            @Override
+//            public boolean isEmpty(){
+//                return getLoaderDependentDelegate().isEmpty();
+//            }
+//
+//            @Override
+//            public boolean containsKey(Object key){
+//                return getLoaderDependentDelegate().containsKey(key);
+//            }
+//
+//            @Override
+//            public boolean containsValue(Object value){
+//                return getLoaderDependentDelegate().containsValue(value);
+//            }
+//
+//            @Override
+//            public String get(Object key){
+//                return getLoaderDependentDelegate().get(key);
+//            }
+//
+//            @Override
+//            public String put(String key, String value){
+//                return getLoaderDependentDelegate().put(key,value);
+//            }
+//
+//            @Override
+//            public String remove(Object key){
+//                return getLoaderDependentDelegate().remove(key);
+//            }
+//
+//            @Override
+//            public void putAll(Map<? extends String,? extends String> m){
+//                getLoaderDependentDelegate().putAll(m);
+//            }
+//
+//            @Override
+//            public void clear(){
+//                getLoaderDependentDelegate().clear();
+//            }
+//
+//            @Override
+//            public Set<String> keySet(){
+//                return getLoaderDependentDelegate().keySet();
+//            }
+//
+//            @Override
+//            public Collection<String> values(){
+//                return getLoaderDependentDelegate().values();
+//            }
+//
+//            @Override
+//            public Set<Entry<String,String>> entrySet(){
+//                return getLoaderDependentDelegate().entrySet();
+//            }
+//
+//        };
+//    }
+//
+//	private Map<String, String> getLoaderDependentDelegate() {
+//		Map<String, String> props = new HashMap<>();
+//		ClassLoader cl = Thread.currentThread().getContextClassLoader();
+//		if (cl == null) {
+//			cl = getClass().getClassLoader();
+//		}
+//		while (cl != null) {
+//			ClasspathModulePropertyProvider cfg = this.configs.get(cl);
+//			if (cfg == null) {
+//				cfg = new ClasspathModulePropertyProvider(cl, this.resources);
+//				this.configs.put(cl, cfg);
+//			}
+//			props.putAll(cfg.toMap());
+//			cl = cl.getParent();
+//		}
+//		return props;
+//	}
+//
+//	@Override
+//	public ConfigChangeSet load() {
+//		Map<String, String> props = new HashMap<>();
+//		ClassLoader cl = Thread.currentThread().getContextClassLoader();
+//		if (cl == null) {
+//			cl = getClass().getClassLoader();
+//		}
+//		while (cl != null) {
+//			ClasspathModulePropertyProvider cfg = this.configs.get(cl);
+//			if (cfg != null) {
+//				cfg.load();
+//			}
+//			cl = cl.getParent();
+//		}
+//        return super.load();
+//	}
+//
+//    @Override
+//    public String toString(){
+//        return "ClasspathPropertyProvider{" +
+//                "configs=" + configs +
+//                ", resources=" + Arrays.toString(resources) +
+//                '}';
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyAdaptersSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyAdaptersSingletonSpi.java
b/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyAdaptersSingletonSpi.java
index 7323132..ba267c7 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyAdaptersSingletonSpi.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyAdaptersSingletonSpi.java
@@ -20,7 +20,7 @@ package org.apache.tamaya.core.internal.properties;
 
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.PropertyAdapter;
-import org.apache.tamaya.mapping.WithPropertyAdapter;
+import org.apache.tamaya.annotation.WithPropertyAdapter;
 import org.apache.tamaya.spi.PropertyAdaptersSingletonSpi;
 import java.math.BigDecimal;
 import java.math.BigInteger;

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyProviderBuilderSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyProviderBuilderSpi.java
b/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyProviderBuilderSpi.java
index eedeee0..fdcfc2a 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyProviderBuilderSpi.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/properties/DefaultPropertyProviderBuilderSpi.java
@@ -279,4 +279,9 @@ public class DefaultPropertyProviderBuilderSpi implements PropertyProviderBuilde
         return new ReplacingPropertyProvider(metaInfo, mainMap, replacementMap);
     }
 
+    @Override
+    public PropertyProvider build(MetaInfo metaInfo, PropertyProvider baseProvider) {
+        return new BuildablePropertyProvider(metaInfo, baseProvider);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/properties/EnvironmentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/properties/EnvironmentPropertyProvider.java
b/core/src/main/java/org/apache/tamaya/core/internal/properties/EnvironmentPropertyProvider.java
index c0ab0de..f95a6ef 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/properties/EnvironmentPropertyProvider.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/properties/EnvironmentPropertyProvider.java
@@ -37,9 +37,7 @@ class EnvironmentPropertyProvider extends AbstractPropertyProvider {
 
     @Override
     public String toString(){
-        return "EnvironmentPropertyMap{" +
-                "props=" + super.toString() +
-                '}';
+        return "EnvironmentPropertyProvider[" + System.getenv().size() + " environment properties]";
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/properties/SystemPropertiesPropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/properties/SystemPropertiesPropertyProvider.java
b/core/src/main/java/org/apache/tamaya/core/internal/properties/SystemPropertiesPropertyProvider.java
index f3fe1da..525da22 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/properties/SystemPropertiesPropertyProvider.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/properties/SystemPropertiesPropertyProvider.java
@@ -49,5 +49,9 @@ class SystemPropertiesPropertyProvider extends AbstractPropertyProvider
{
         return Collections.unmodifiableMap(props);
     }
 
+    @Override
+    public String toString(){
+        return "SystemPropertiesPropertyProvider[" + System.getProperties().size() + " system
properties]";
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/resources/io/AntPathMatcher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/resources/io/AntPathMatcher.java
b/core/src/main/java/org/apache/tamaya/core/internal/resources/io/AntPathMatcher.java
index 09051ae..0e637a2 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/resources/io/AntPathMatcher.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/resources/io/AntPathMatcher.java
@@ -23,9 +23,9 @@ import java.util.regex.Pattern;
 /**
  * PathMatcher implementation for Ant-style path patterns. Examples are provided below.
  *
- * <p>Part current this mapping code has been kindly borrowed from <a href="http://ant.apache.org">Apache
Ant</a>.
+ * <p>Part current this annotation code has been kindly borrowed from <a href="http://ant.apache.org">Apache
Ant</a>.
  *
- * <p>The mapping matches URLs using the following rules:<br> <ul> <li>?
matches one character</li> <li>* matches zero
+ * <p>The annotation matches URLs using the following rules:<br> <ul> <li>?
matches one character</li> <li>* matches zero
  * or more characters</li> <li>** matches zero or more 'directories' in a path</li>
</ul>
  *
  * <p>Some examples:<br> <ul> <li>{@code com/t?st.jsp} - matches
{@code com/test.jsp} but also

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/internal/resources/io/PathMatchingResourcePatternResolver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/resources/io/PathMatchingResourcePatternResolver.java
b/core/src/main/java/org/apache/tamaya/core/internal/resources/io/PathMatchingResourcePatternResolver.java
index a72fe21..0e81aa9 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/resources/io/PathMatchingResourcePatternResolver.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/resources/io/PathMatchingResourcePatternResolver.java
@@ -39,7 +39,7 @@ import java.util.logging.Logger;
 /**
  * A {@code ResourcePatternResolver} implementation that is able to resolve a
  * specified resource location path into one or more matching Resources.
- * The source path may be a simple path which has a one-to-one mapping to a
+ * The source path may be a simple path which has a one-to-one annotation to a
  * target {@code org.springframework.core.io.Resource}, or alternatively
  * may contain the special "{@code classpath*:}" prefix and/or
  * internal Ant-style regular expressions (matched using Spring's

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/main/java/org/apache/tamaya/core/properties/ClasspathModulePropertyProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/ClasspathModulePropertyProvider.java
b/core/src/main/java/org/apache/tamaya/core/properties/ClasspathModulePropertyProvider.java
deleted file mode 100644
index 2503b35..0000000
--- a/core/src/main/java/org/apache/tamaya/core/properties/ClasspathModulePropertyProvider.java
+++ /dev/null
@@ -1,80 +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.properties;
-
-import org.apache.tamaya.core.resource.ResourceLoader;
-
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.spi.Bootstrap;
-
-import java.io.InputStream;
-import java.net.URI;
-import java.util.*;
-
-public class ClasspathModulePropertyProvider extends AbstractPropertyProvider{
-
-    private static final long serialVersionUID = 8488347395634476626L;
-	private ClassLoader classLoader;
-	private String[] sources;
-
-	public ClasspathModulePropertyProvider(ClassLoader classLoader, String... sources) {
-        super(MetaInfoBuilder.of().set("classloader", classLoader.toString()).setSourceExpressions(sources).build());
-		Objects.requireNonNull(classLoader);
-		this.classLoader = classLoader;
-		this.sources = sources.clone();
-		load(); // trigger initialization
-	}
-
-	public ClassLoader getClassLoader() {
-		return this.classLoader;
-	}
-
-
-	@Override
-	public Map<String,String> toMap() {
-        Map<String,String> content = new HashMap<>();
-		for (String srcPattern : sources) {
-			List<URI> urls = null;
-			try {
-				Bootstrap.getService(ResourceLoader.class).getResources(classLoader, srcPattern);
-			} catch (Exception e1) {
-				e1.printStackTrace();
-			}
-			if (urls == null) {
-				return content;
-			}
-            MetaInfoBuilder mb = MetaInfoBuilder.of(getMetaInfo());
-			for (URI url : urls) {
-				InputStream is = null;
-				try {
-					Properties props = new Properties();
-					is = url.toURL().openStream();
-					props.loadFromXML(is);
-					addSource(url.toString());
-					for (Map.Entry<Object, Object> en : props.entrySet()) {
-                        content.put(en.getKey().toString(), en.getValue().toString());
-					}
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-		}
-        return content;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
b/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
index 924d71b..f8d4294 100644
--- a/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
+++ b/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
@@ -23,8 +23,8 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.tamaya.mapping.ConfiguredProperty;
-import org.apache.tamaya.mapping.DefaultValue;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
 import org.apache.tamaya.core.internal.config.DefaultConfigurationManagerSingletonSpi;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
b/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
deleted file mode 100644
index a9aab61..0000000
--- a/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
+++ /dev/null
@@ -1,74 +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.config;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.tamaya.core.properties.ClasspathModulePropertyProvider;
-import org.junit.Test;
-
-public class ClasspathModulePropertyMapTest{
-
-	@Test
-	public void testGetMetaInfoString() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testGetMetaInfo() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testClasspathModuleConfigUnit() {
-		ClasspathModulePropertyProvider u = new ClasspathModulePropertyProvider(
-				ClasspathModulePropertyProvider.class.getClassLoader(),
-				"cfg/test.xml");
-
-		System.out.println(u);
-		assertEquals("testValue", u.get("testFromXml"));
-	}
-
-	@Test
-	public void testGetClassLoader() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testGetProperty() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testGetProperties() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testIsActive() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testToString() {
-		fail("Not yet implemented");
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
index ed440a0..b28714e 100644
--- a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
+++ b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
@@ -18,8 +18,8 @@
  */
 package org.apache.tamaya.samples.annotations;
 
-import org.apache.tamaya.mapping.ConfiguredProperty;
-import org.apache.tamaya.mapping.DefaultValue;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
 
 import java.math.BigDecimal;
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
index 41654ed..fa2868c 100644
--- a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
+++ b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
@@ -18,10 +18,10 @@
  */
 package org.apache.tamaya.samples.annotations;
 
-import org.apache.tamaya.mapping.ConfigChangeListener;
-import org.apache.tamaya.mapping.ConfiguredProperty;
-import org.apache.tamaya.mapping.DefaultValue;
-import org.apache.tamaya.mapping.WithConfig;
+import org.apache.tamaya.annotation.ConfigChangeListener;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.WithConfig;
 
 import java.beans.PropertyChangeEvent;
 import java.math.BigDecimal;

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java b/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
index f67dce3..d582ffc 100644
--- a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
+++ b/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
@@ -1,9 +1,9 @@
 package main.java.metamodel.ext.cdi;
 
-import org.apache.tamaya.mapping.ConfigChangeListener;
-import org.apache.tamaya.mapping.ConfiguredProperty;
-import org.apache.tamaya.mapping.DefaultValue;
-import org.apache.tamaya.mapping.WithConfig;
+import org.apache.tamaya.annotation.ConfigChangeListener;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.WithConfig;
 
 import javax.inject.Singleton;
 import java.beans.PropertyChangeEvent;

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/modules/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/metamodel/pom.xml b/modules/metamodel/pom.xml
index c8161f1..6bd6002 100644
--- a/modules/metamodel/pom.xml
+++ b/modules/metamodel/pom.xml
@@ -27,7 +27,7 @@ under the License.
         <relativePath>..</relativePath>
     </parent>
     <artifactId>tamaya-ext-metamodel</artifactId>
-    <name>Apache Tamaya Module - Management Beans</name>
+    <name>Apache Tamaya Module - Configuration Metamodels</name>
     <packaging>jar</packaging>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
----------------------------------------------------------------------
diff --git a/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java b/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
new file mode 100644
index 0000000..cef6408
--- /dev/null
+++ b/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
@@ -0,0 +1,55 @@
+/*
+ * 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 main.java.metamodel;
+
+import org.apache.tamaya.core.experimental.ConfigurationBuilder;
+import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
+
+/**
+ * Created by Anatole on 30.09.2014.
+ */
+public class DefaultConfigProvider implements ConfigurationProviderSpi{
+
+    private Configuration config;
+
+    @Override
+    public String getConfigName(){
+        return "default";
+    }
+
+    @Override
+    public Configuration getConfiguration(){
+        if(config == null){
+            config = ConfigBuilder.create(getConfigName()
+                            .addPaths(
+                                    "classpath*:META-INF/config/**/*.xml", "classpath*:META-INF/config/**/*.properties",
+                                    "classpath*:META-INF/config/**/*.init")
+                            .addPaths("classpath*:META-INF/config/**/*.xml", "classpath*:META-INF/config/**/*.properties",
+                                    "classpath*:META-INF/config/**/*.init")
+                    addConfig(AggregationPolicy.IGNORE_DUPLICATES(),
+                            ConfigBuilder.create("Default Configuration")
+                                    .addPaths("classpath*:META-INF/config/**/*.xml",
+                                            "classpath*:META-INF/config/**/*" + ".properties",
+                                            "classpath*:META-INF/config/**/*.ini").build())
+                            .addConfig(AggregationPolicy.IGNORE_DUPLICATES(), Configuration.fromEnvironmentProperties(),
+                                    Configuration.fromSystemProperties()).build();
+        }
+        return config;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/5c36d32d/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
b/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
new file mode 100644
index 0000000..5865575
--- /dev/null
+++ b/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.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.ext.metamodel.DefaultConfigProvider
\ No newline at end of file


Mime
View raw message