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 2014/12/24 02:12:13 UTC
[3/6] incubator-tamaya git commit: TAMAYA-19: - Moved out much of
unused/experimental code. - Reduced API (removing package private singletons)
- Aligned PropertySource with Deltaspike (mostly). - Moved Environment model
to separate metamodel module.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/IntersectingPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/IntersectingPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/IntersectingPropertySource.java
index bc22822..d7c46d2 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/IntersectingPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/IntersectingPropertySource.java
@@ -34,33 +34,21 @@ class IntersectingPropertySource extends AbstractPropertySource {
private List<PropertySource> providers;
private PropertySource aggregatedDelegate;
- public IntersectingPropertySource(MetaInfo metaInfo, AggregationPolicy policy, List<PropertySource> providers) {
- super(MetaInfoBuilder.of(metaInfo).setType("intersection").build());
+ public IntersectingPropertySource(String name, AggregationPolicy policy, List<PropertySource> providers) {
+ super(name);
this.providers = new ArrayList<>(providers);
- aggregatedDelegate = PropertySourceBuilder.of(getMetaInfo()).withAggregationPolicy(policy)
+ aggregatedDelegate = PropertySourceBuilder.of(name).withAggregationPolicy(policy)
.addProviders(this.providers).build();
}
@Override
public Optional<String> get(String key) {
- if (containsKey(key))
- return aggregatedDelegate.get(key);
- return Optional.empty();
+ return aggregatedDelegate.get(key);
}
@Override
- public boolean containsKey(String key) {
- for (PropertySource prov : this.providers) {
- if (!prov.containsKey(key)) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public Map<String, String> toMap() {
- return aggregatedDelegate.toMap().entrySet().stream().filter(en -> containsKey(en.getKey())).collect(
+ public Map<String, String> getProperties() {
+ return aggregatedDelegate.getProperties().entrySet().stream().filter(en -> get(en.getKey()).isPresent()).collect(
Collectors.toConcurrentMap(Map.Entry::getKey, Map.Entry::getValue));
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/MapBasedPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/MapBasedPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/MapBasedPropertySource.java
index 9f2e90c..d4c8968 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/MapBasedPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/MapBasedPropertySource.java
@@ -44,8 +44,8 @@ class MapBasedPropertySource extends AbstractPropertySource {
*
* @param entries the config entries, not null.
*/
- MapBasedPropertySource(MetaInfo metaInfo, Map<String, String> entries){
- super(metaInfo);
+ MapBasedPropertySource(String name, Map<String, String> entries){
+ super(name);
Objects.requireNonNull(entries, "entries required.");
this.entries.putAll(entries);
}
@@ -58,21 +58,21 @@ class MapBasedPropertySource extends AbstractPropertySource {
* @param sources the sources
* @param errors the errors
*/
- MapBasedPropertySource(MetaInfo metaInfo, Map<String, String> entries, Set<String> sources,
+ MapBasedPropertySource(String name, Map<String, String> entries, Set<String> sources,
Collection<Throwable> errors){
- super(metaInfo);
+ super(name);
Objects.requireNonNull(entries, "entries required.");
this.entries.putAll(entries);
addSources(sources);
}
- MapBasedPropertySource(MetaInfo metaInfo, Set<String> sources){
- super(metaInfo);
+ MapBasedPropertySource(String name, Set<String> sources){
+ super(name);
addSources(sources);
}
@Override
- public Map<String, String> toMap() {
+ public Map<String, String> getProperties() {
return new HashMap<>(this.entries);
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/PathBasedPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/PathBasedPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/PathBasedPropertySource.java
index 4ea663a..56426ca 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/PathBasedPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/PathBasedPropertySource.java
@@ -19,10 +19,9 @@
package org.apache.tamaya.core.properties;
import org.apache.tamaya.*;
-import org.apache.tamaya.core.config.ConfigurationFormats;
import org.apache.tamaya.core.resource.Resource;
import org.apache.tamaya.spi.ServiceContext;
-import org.apache.tamaya.core.spi.ConfigurationFormat;
+import org.apache.tamaya.core.config.ConfigurationFormat;
import org.apache.tamaya.core.resource.ResourceLoader;
import java.util.*;
@@ -37,15 +36,15 @@ final class PathBasedPropertySource extends AbstractPropertySource {
private Map<String, String> properties = new HashMap<>();
private AggregationPolicy aggregationPolicy;
- public PathBasedPropertySource(MetaInfo metaInfo, Collection<String> paths, AggregationPolicy aggregationPolicy) {
- super(metaInfo);
+ public PathBasedPropertySource(String name, Collection<String> paths, AggregationPolicy aggregationPolicy) {
+ super(name);
this.paths.addAll(Objects.requireNonNull(paths));
this.aggregationPolicy = Objects.requireNonNull(aggregationPolicy);
init();
}
@Override
- public Map<String, String> toMap() {
+ public Map<String, String> getProperties() {
return this.properties;
}
@@ -55,7 +54,7 @@ final class PathBasedPropertySource extends AbstractPropertySource {
paths.forEach((path) -> {
effectivePaths.add(path);
for (Resource res : ServiceContext.getInstance().getSingleton(ResourceLoader.class).getResources(path)) {
- ConfigurationFormat format = ConfigurationFormats.getFormat(res);
+ ConfigurationFormat format = ConfigurationFormat.from(res);
if (format != null) {
try {
Map<String, String> read = format.readConfiguration(res);
@@ -78,8 +77,8 @@ final class PathBasedPropertySource extends AbstractPropertySource {
}
}
});
- metaInfo = MetaInfoBuilder.of(getMetaInfo())
- .setSourceExpressions(new String[effectivePaths.size()])
- .set("sources", sources.toString()).build();
+// metaInfo = MetaInfoBuilder.of(getMetaInfo())
+// .setSourceExpressions(new String[effectivePaths.size()])
+// .set("sources", sources.toString()).build();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceBuilder.java b/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceBuilder.java
index a2376d4..5cc93ad 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceBuilder.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceBuilder.java
@@ -27,6 +27,7 @@ import java.util.Objects;
import java.util.function.Predicate;
import java.util.function.Supplier;
+import com.oracle.webservices.internal.api.message.PropertySet;
import org.apache.tamaya.AggregationPolicy;
import org.apache.tamaya.MetaInfo;
import org.apache.tamaya.MetaInfoBuilder;
@@ -36,19 +37,16 @@ import org.apache.tamaya.PropertySource;
* Builder for assembling non trivial property providers.
*/
public final class PropertySourceBuilder {
-// private static final Supplier<IllegalStateException> noPropertyProviderAvailable =
-// () -> new IllegalStateException("No PropertyProvidersSingletonSpi available.");
-
/**
- * The final meta info to be used, or null, if a default should be generated.
+ * Name used for the final result.
*/
- private MetaInfoBuilder metaInfoBuilder;
+ private String name;
/**
- * Meta info used for the next operation.
+ * Name used for the next operation.
*/
- private MetaInfo metaInfo;
+ private String currentName;
/**
* the current property provider, or null.
@@ -62,46 +60,40 @@ public final class PropertySourceBuilder {
/**
* Private singleton constructor.
*/
- private PropertySourceBuilder(MetaInfo metaInfo) {
- this.metaInfoBuilder = MetaInfoBuilder.of(Objects.requireNonNull(metaInfo)).setInfo("Built by PropertyProviderBuilder.");
- }
-
- /**
- * Private singleton constructor.
- */
private PropertySourceBuilder(String name) {
- this.metaInfoBuilder = MetaInfoBuilder.of(name);
+ this.name = Objects.requireNonNull(name);
}
/**
* Private singleton constructor.
*/
- private PropertySourceBuilder(PropertySource provider) {
- this.metaInfoBuilder = MetaInfoBuilder.of(Objects.requireNonNull(provider).getMetaInfo());
- this.current = provider;
+ private PropertySourceBuilder(String name, PropertySource propertySource) {
+ this.name = Objects.requireNonNull(name);
+ this.current = propertySource;
}
-
/**
* Creates a new builder instance.
*
+ * @param name the provider name, not null.
* @param provider the base provider to be used, not null.
* @return a new builder instance, never null.
*/
- public static PropertySourceBuilder of(PropertySource provider) {
- return new PropertySourceBuilder(provider);
+ public static PropertySourceBuilder of(String name, PropertySource provider) {
+ return new PropertySourceBuilder(name, provider);
}
/**
* Creates a new builder instance.
*
- * @param metaInfo the meta information, not null.
+ * @param provider the base provider to be used, not null.
* @return a new builder instance, never null.
*/
- public static PropertySourceBuilder of(MetaInfo metaInfo) {
- return new PropertySourceBuilder(metaInfo);
+ public static PropertySourceBuilder of(PropertySource provider) {
+ return new PropertySourceBuilder(provider.getName(), provider);
}
+
/**
* Creates a new builder instance.
*
@@ -137,17 +129,6 @@ public final class PropertySourceBuilder {
}
/**
- * Sets the meta info to be used for the next operation.
- *
- * @param metaInfo the meta info, not null.
- * @return the builder for chaining.
- */
- public PropertySourceBuilder withMetaInfo(MetaInfo metaInfo) {
- this.metaInfo = Objects.requireNonNull(metaInfo);
- return this;
- }
-
- /**
* Adds the given providers with the current active {@link org.apache.tamaya.AggregationPolicy}. By
* default {@link org.apache.tamaya.AggregationPolicy#OVERRIDE} is used.
* @see #withAggregationPolicy(AggregationPolicy)
@@ -177,33 +158,18 @@ public final class PropertySourceBuilder {
allProviders.add(0, this.current);
}
StringBuilder b = new StringBuilder();
- providers.forEach(p -> b.append(p.getMetaInfo().toString()).append(','));
+ providers.forEach(p -> b.append(p.getName()).append(','));
b.setLength(b.length()-1);
String source = b.toString();
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("aggregate")
- .setSources(source).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<aggregate> -> source=" + source;
}
- this.current = PropertySourceFactory.aggregate(mi, this.aggregationPolicy, allProviders);
-
- addProviderChainInfo(source);
- this.metaInfo = null;
+ this.current = PropertySourceFactory.aggregate(name, this.aggregationPolicy, allProviders);
+ this.currentName = null;
return this;
}
- private void addProviderChainInfo(String info){
- String providerChain = metaInfoBuilder.get("providerChain");
-
- if(providerChain == null){
- providerChain = "\n " + info;
- }
- else{
- providerChain = providerChain + ",\n " + info;
- }
- metaInfoBuilder.set("providerChain", providerChain);
- }
-
/**
* Creates a new {@link PropertySource} using the given command line arguments and adds it
* using the current aggregation policy in place.
@@ -215,11 +181,11 @@ public final class PropertySourceBuilder {
if(args.length==0){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("args").build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<CLI-args>";
}
- PropertySource argProvider = PropertySourceFactory.fromArgs(mi, args);
+ PropertySource argProvider = PropertySourceFactory.fromArgs(name, args);
return addProviders(argProvider);
}
@@ -251,13 +217,11 @@ public final class PropertySourceBuilder {
if(paths.isEmpty()){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("aggregate").set("paths", paths.toString()).build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).set("paths", paths.toString()).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<aggregate> -> paths=" + paths.toString();
}
- return addProviders(PropertySourceFactory.fromPaths(mi, aggregationPolicy, paths));
+ return addProviders(PropertySourceFactory.fromPaths(name, aggregationPolicy, paths));
}
/**
@@ -285,14 +249,11 @@ public final class PropertySourceBuilder {
if(urls.isEmpty()){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("aggregate").set("urls", urls.toString()).build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).set("urls", urls.toString()).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<aggregate> -> urls=" + urls;
}
-
- return addProviders(PropertySourceFactory.fromURLs(mi, this.aggregationPolicy, urls));
+ return addProviders(PropertySourceFactory.fromURLs(name, this.aggregationPolicy, urls));
}
@@ -307,13 +268,11 @@ public final class PropertySourceBuilder {
if(map.isEmpty()){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("map").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<Map> -> map=" + map;
}
- return addProviders(PropertySourceFactory.fromMap(mi, map));
+ return addProviders(PropertySourceFactory.fromMap(name, map));
}
@@ -323,13 +282,10 @@ public final class PropertySourceBuilder {
* @return the builder for chaining.
*/
public PropertySourceBuilder addEnvironmentProperties() {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("environment.properties").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<System.getenv()>";
}
-
return addProviders(PropertySourceFactory.fromEnvironmentProperties());
}
@@ -339,17 +295,24 @@ public final class PropertySourceBuilder {
* @return the builder for chaining.
*/
public PropertySourceBuilder addSystemProperties() {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("system.properties").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<System.getProperties()>";
}
-
return addProviders(PropertySourceFactory.fromSystemProperties());
}
/**
+ * Add the name used for the next aggregation/adding operation on this builder.
+ * @param name the name to be used, not null.
+ * @return the builder for chaining.
+ */
+ public PropertySourceBuilder withName(String name) {
+ this. currentName = Objects.requireNonNull(name);
+ return this;
+ }
+
+ /**
* Adds the given {@link org.apache.tamaya.PropertySource} instances using the current {@link org.apache.tamaya.AggregationPolicy}
* active.
*
@@ -360,14 +323,11 @@ public final class PropertySourceBuilder {
if(providers.length==0){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("aggregate").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<aggregate> -> " + Arrays.toString(providers);
}
-
- return addProviders(PropertySourceFactory.aggregate(mi, aggregationPolicy, Arrays.asList(providers)));
+ return addProviders(PropertySourceFactory.aggregate(name, aggregationPolicy, Arrays.asList(providers)));
}
@@ -382,14 +342,11 @@ public final class PropertySourceBuilder {
if(providers.isEmpty()){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("aggregate").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<aggregate> -> " + providers;
}
-
- return addProviders(PropertySourceFactory.aggregate(mi, aggregationPolicy, providers));
+ return addProviders(PropertySourceFactory.aggregate(name, aggregationPolicy, providers));
}
@@ -415,14 +372,11 @@ public final class PropertySourceBuilder {
if(providers.length==0){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("intersect").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<intersection> -> " + Arrays.toString(providers);
}
-
- return addProviders(PropertySourceFactory.intersected(mi, aggregationPolicy, Arrays.asList(providers)));
+ return addProviders(PropertySourceFactory.intersected(name, aggregationPolicy, Arrays.asList(providers)));
}
@@ -436,13 +390,11 @@ public final class PropertySourceBuilder {
if(providers.length==0){
return this;
}
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("subtract").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<subtraction> -> " + Arrays.toString(providers);
}
- current = PropertySourceFactory.subtracted(mi, current, Arrays.asList(providers));
+ current = PropertySourceFactory.subtracted(name, current, Arrays.asList(providers));
return this;
}
@@ -454,15 +406,12 @@ public final class PropertySourceBuilder {
* @return the new filtering instance.
*/
public PropertySourceBuilder filter(Predicate<String> filter) {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("filtered").set("filter", filter.toString()).build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).set("filter", filter.toString()).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<filtered> -> " + filter;
}
- current = PropertySourceFactory.filtered(mi, filter, current);
- addProviderChainInfo("filter->" + filter.toString());
- this.metaInfo = null;
+ current = PropertySourceFactory.filtered(name, filter, current);
+ this.currentName = null;
return this;
}
@@ -475,14 +424,11 @@ public final class PropertySourceBuilder {
*/
public PropertySourceBuilder addContextual(Supplier<PropertySource> mapSupplier,
Supplier<String> isolationKeySupplier) {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("contextual").set("mapSupplier", mapSupplier.toString()).set("isolationKeySupplier", isolationKeySupplier.toString()).build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).set("mapSupplier", mapSupplier.toString()).set("isolationKeySupplier", isolationKeySupplier.toString()).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<contextual> -> map="+mapSupplier+",isolationKeySupplier="+isolationKeySupplier;
}
-
- return addProviders(PropertySourceFactory.contextual(mi, mapSupplier, isolationKeySupplier));
+ return addProviders(PropertySourceFactory.contextual(name, mapSupplier, isolationKeySupplier));
}
/**
@@ -492,28 +438,12 @@ public final class PropertySourceBuilder {
* @return the new delegating instance.
*/
public PropertySourceBuilder replace(Map<String, String> replacementMap) {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("replace").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<replacement> -> current="+current.getName()+" with ="+replacementMap;
}
- current = PropertySourceFactory.replacing(mi, current, replacementMap);
- this.metaInfo = null;
- addProviderChainInfo("replace->" + replacementMap.toString());
- return this;
- }
-
- /**
- * Sets an additional key on the final {@link org.apache.tamaya.MetaInfo} of the provider
- * created.
- *
- * @param key the key to be added, not null.
- * @param value the keys to be added, not null.
- * @return this builder for chaining
- */
- public PropertySourceBuilder setMeta(String key, String value){
- this.metaInfoBuilder.set(key, value);
+ current = PropertySourceFactory.replacing(name, current, replacementMap);
+ this.currentName = null;
return this;
}
@@ -523,10 +453,9 @@ public final class PropertySourceBuilder {
*/
public PropertySource build(){
if (current != null) {
- return PropertySourceFactory.build(metaInfoBuilder.build(), current);
+ return PropertySourceFactory.build(name, current);
}
-
- return PropertySourceFactory.empty(metaInfoBuilder.build());
+ return PropertySourceFactory.empty(name);
}
/**
@@ -536,15 +465,12 @@ public final class PropertySourceBuilder {
* @return the freezed instance, never null.
*/
public PropertySource buildFreezed() {
- MetaInfo mi = this.metaInfo;
- if (mi == null) {
- mi = MetaInfoBuilder.of("freezed").set("freezed", "true").build();
- } else {
- mi = MetaInfoBuilder.of(metaInfo).set("freezed", "true").build();
+ String name = this.currentName;
+ if (currentName == null) {
+ name = "<freezed> -> source="+current.getName();
}
-
- PropertySource prov = PropertySourceFactory.freezed(mi, current);
- this.metaInfo = null;
+ PropertySource prov = PropertySourceFactory.freezed(name, current);
+ this.currentName = null;
return prov;
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceFactory.java b/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceFactory.java
index b007ea8..34b1cd9 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceFactory.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/PropertySourceFactory.java
@@ -20,12 +20,7 @@ package org.apache.tamaya.core.properties;
import java.net.URL;
import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.function.Predicate;
import java.util.function.Supplier;
@@ -39,7 +34,7 @@ import org.apache.tamaya.PropertySource;
*/
public final class PropertySourceFactory {
- private static final PropertySource EMPTY_PROPERTYSOURCE = fromMap(MetaInfo.of("<empty>"), Collections.emptyMap());
+ private static final PropertySource EMPTY_PROPERTYSOURCE = fromMap("<empty>", Collections.emptyMap());
private static final PropertySource ENV_PROPERTYSOURCE = new EnvironmentPropertySource();
@@ -48,9 +43,9 @@ public final class PropertySourceFactory {
*/
private PropertySourceFactory(){}
- public static PropertySource fromArgs(MetaInfo metaInfo, String... args) {
- if(metaInfo==null){
- metaInfo = MetaInfo.of("CLI");
+ public static PropertySource fromArgs(String name, String... args) {
+ if(name==null){
+ name ="<CLI> " + Arrays.toString(args);
}
// TODO read the CLI with some better library, e.g. move parsing service to ext. service SPI
Map<String, String> properties = new HashMap<>();
@@ -91,35 +86,35 @@ public final class PropertySourceFactory {
properties.put(argKey, value);
}
}
- return fromMap(metaInfo, properties);
+ return fromMap(name, properties);
}
- public static PropertySource fromPaths(MetaInfo metaInfo, AggregationPolicy aggregationPolicy, List<String> paths) {
- if(metaInfo == null){
- metaInfo = MetaInfoBuilder.of().setInfo("From Paths").set("paths", paths.toString()).build();
+ public static PropertySource fromPaths(String name, AggregationPolicy aggregationPolicy, List<String> paths) {
+ if(name==null){
+ name ="<Paths> " + paths.toString();
}
- return new PathBasedPropertySource(metaInfo, paths, aggregationPolicy);
+ return new PathBasedPropertySource(name, paths, aggregationPolicy);
}
- public static PropertySource fromURLs(MetaInfo metaInfo, AggregationPolicy aggregationPolicy, List<URL> resources) {
- if(metaInfo == null){
- metaInfo = MetaInfoBuilder.of().setInfo("From Resources").set("resources", resources.toString()).build();
+ public static PropertySource fromURLs(String name, AggregationPolicy aggregationPolicy, List<URL> urls) {
+ if(name==null){
+ name ="<URLs> " + urls.toString();
}
- return new URLBasedPropertySource(metaInfo, resources, aggregationPolicy);
+ return new URLBasedPropertySource(name, urls, aggregationPolicy);
}
- public static PropertySource fromMap(MetaInfo metaInfo, Map<String, String> map) {
- if(metaInfo == null){
- metaInfo = MetaInfoBuilder.of().setInfo("From Map").set("map", map.toString()).build();
+ public static PropertySource fromMap(String name, Map<String, String> map) {
+ if(name==null){
+ name ="<Map> " + map.toString();
}
- return new MapBasedPropertySource(metaInfo, map);
+ return new MapBasedPropertySource(name, map);
}
- public static PropertySource empty(MetaInfo metaInfo) {
- if(metaInfo==null) {
+ public static PropertySource empty(String name) {
+ if(name==null) {
return EMPTY_PROPERTYSOURCE;
}
- return fromMap(metaInfo, Collections.emptyMap());
+ return fromMap(name, Collections.emptyMap());
}
/**
@@ -140,20 +135,11 @@ public final class PropertySourceFactory {
return new SystemPropertiesPropertySource();
}
- public static PropertySource freezed(MetaInfo metaInfo, PropertySource provider) {
- if(metaInfo==null){
- metaInfo = MetaInfoBuilder.of().setType("freezed")
- .set("provider", provider.toString())
- .set("freezedAt", Date.from(Instant.now()).toString())
- .build();
+ public static PropertySource freezed(String name, PropertySource source) {
+ if(name==null){
+ name ="<Freezed> source=" + source.toString()+", at="+Instant.now().toString();
}
- else{
- metaInfo = MetaInfoBuilder.of(metaInfo).setType("freezed")
- .set("freezedAt", Date.from(Instant.now()).toString())
- .set("provider", provider.toString())
- .build();
- }
- return FreezedPropertySource.of(metaInfo, provider);
+ return FreezedPropertySource.of(name, source);
}
/**
@@ -163,14 +149,11 @@ public final class PropertySourceFactory {
* @param providers the maps to be included, not null.
* @return the aggregated instance containing all given maps.
*/
- public static PropertySource aggregate(MetaInfo metaInfo, AggregationPolicy policy, List<PropertySource> providers) {
- if(metaInfo==null){
- metaInfo = MetaInfoBuilder.of().setInfo("Aggregated")
- .set("AggregationPolicy", policy.toString())
- .set("config", providers.toString())
- .build();
+ public static PropertySource aggregate(String name, AggregationPolicy policy, List<PropertySource> providers) {
+ if(name==null){
+ name ="<Aggregate> policy=" + policy.toString()+", providers="+providers.toString();
}
- return new AggregatedPropertySource(metaInfo, null, policy, providers);
+ return new AggregatedPropertySource(name, null, policy, providers);
}
/**
@@ -179,17 +162,15 @@ public final class PropertySourceFactory {
* @param provider the provider to be made mutable, not null.
* @return the mutable instance.
*/
- public static PropertySource mutable(MetaInfo metaInfo, PropertySource provider) {
- if(metaInfo==null){
- metaInfo = MetaInfoBuilder.of(provider.getMetaInfo())
- .set("mutableSince", Date.from(Instant.now()).toString())
- .build();
+ public static PropertySource mutable(String name, PropertySource provider) {
+ if(name==null){
+ name ="<Mutable> provider="+provider.getName();
}
- PropertySource mutableProvider = fromMap(metaInfo,new HashMap<>());
+ PropertySource mutableProvider = fromMap(name,new HashMap<>());
List<PropertySource> providers = new ArrayList<>(2);
providers.add(provider);
providers.add(mutableProvider);
- return new AggregatedPropertySource(metaInfo, mutableProvider, AggregationPolicy.OVERRIDE, providers);
+ return new AggregatedPropertySource(name, mutableProvider, AggregationPolicy.OVERRIDE, providers);
}
/**
@@ -199,8 +180,8 @@ public final class PropertySourceFactory {
* @param providers the maps to be included, not null.
* @return the intersecting instance containing all given maps.
*/
- public static PropertySource intersected(MetaInfo metaInfo, AggregationPolicy aggregationPolicy, List<PropertySource> providers) {
- return new IntersectingPropertySource(metaInfo, aggregationPolicy, providers);
+ public static PropertySource intersected(String name, AggregationPolicy aggregationPolicy, List<PropertySource> providers) {
+ return new IntersectingPropertySource(name, aggregationPolicy, providers);
}
/**
@@ -211,8 +192,8 @@ public final class PropertySourceFactory {
* @param subtrahendSets the maps to be subtracted, not null.
* @return the intersecting instance containing all given maps.
*/
- public static PropertySource subtracted(MetaInfo metaInfo, PropertySource target, List<PropertySource> subtrahendSets) {
- return new SubtractingPropertySource(metaInfo, target,subtrahendSets);
+ public static PropertySource subtracted(String name, PropertySource target, List<PropertySource> subtrahendSets) {
+ return new SubtractingPropertySource(name, target,subtrahendSets);
}
@@ -220,12 +201,15 @@ public final class PropertySourceFactory {
* Creates a filtered {@link org.apache.tamaya.PropertySource} (a view) current a given base {@link }PropertyMap}. The filter hereby is
* applied dynamically on access, so also runtime changes current the base map are reflected appropriately.
*
- * @param propertyMap the base map instance, not null.
+ * @param name the base map instance, not null.
* @param filter the filtger to be applied, not null.
* @return the new filtering instance.
*/
- public static PropertySource filtered(MetaInfo metaInfo, Predicate<String> filter, PropertySource propertyMap) {
- return new FilteredPropertySource(metaInfo, propertyMap, filter);
+ public static PropertySource filtered(String name, Predicate<String> filter, PropertySource source) {
+ if(name==null){
+ name ="<Filtered> filter="+filter+", source="+source.getName();
+ }
+ return new FilteredPropertySource(name, source, filter);
}
/**
@@ -235,9 +219,12 @@ public final class PropertySourceFactory {
* @param mapSupplier the supplier creating new provider instances
* @param isolationKeySupplier the supplier providing contextual keys based on the current environment.
*/
- public static PropertySource contextual(MetaInfo metaInfo, Supplier<PropertySource> mapSupplier,
+ public static PropertySource contextual(String name, Supplier<PropertySource> mapSupplier,
Supplier<String> isolationKeySupplier) {
- return new ContextualPropertySource(metaInfo, mapSupplier, isolationKeySupplier);
+ if(name==null){
+ name ="<Contextual> mapSupplier="+mapSupplier+", isolationKeyProvider="+isolationKeySupplier;
+ }
+ return new ContextualPropertySource(name, mapSupplier, isolationKeySupplier);
}
@@ -245,12 +232,15 @@ public final class PropertySourceFactory {
* Creates a filtered {@link org.apache.tamaya.PropertySource} (a view) current a given base {@link }PropertyMap}. The filter hereby is
* applied dynamically on access, so also runtime changes current the base map are reflected appropriately.
*
- * @param mainMap the main map instance, not null.
+ * @param source the main map instance, not null.
* @param parentMap the delegated parent map instance, not null.
* @return the new delegating instance.
*/
- public static PropertySource delegating(MetaInfo metaInfo, PropertySource mainMap, Map<String, String> parentMap) {
- return new DelegatingPropertySource(metaInfo, mainMap, parentMap);
+ public static PropertySource delegating(String name, PropertySource source, Map<String, String> parentMap) {
+ if(name==null){
+ name ="<Delegating> source="+source+", delegates="+parentMap;
+ }
+ return new DelegatingPropertySource(name, source, parentMap);
}
/**
@@ -266,19 +256,22 @@ public final class PropertySourceFactory {
* @param replacementMap the map instance, that will replace all corresponding entries in {@code mainMap}, not null.
* @return the new delegating instance.
*/
- public static PropertySource replacing(MetaInfo metaInfo, PropertySource mainMap, Map<String, String> replacementMap) {
- return new ReplacingPropertySource(metaInfo, mainMap, replacementMap);
+ public static PropertySource replacing(String name, PropertySource source, Map<String, String> replacementMap) {
+ if(name==null){
+ name ="<Replacement> source="+source+", replacements="+replacementMap;
+ }
+ return new ReplacingPropertySource(name, source, replacementMap);
}
/**
* Creates a new {@link org.apache.tamaya.PropertySource} given an existing one, and an alternate
* meta-info.
- * @param metaInfo the new meta-information, not null.
+ * @param name the new meta-information, not null.
* @param baseProvider the property source, not null.
* @return the new property source.never null.
*/
- public static PropertySource build(MetaInfo metaInfo, PropertySource baseProvider) {
- return new BuildablePropertySource(metaInfo, baseProvider);
+ public static PropertySource build(String name, PropertySource baseProvider) {
+ return new BuildablePropertySource(name, baseProvider);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/ReplacingPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/ReplacingPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/ReplacingPropertySource.java
index dfc68c2..a5f49fe 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/ReplacingPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/ReplacingPropertySource.java
@@ -34,7 +34,7 @@ class ReplacingPropertySource implements PropertySource {
private PropertySource mainMap;
private Map<String,String> replacingMap;
- private MetaInfo metaInfo;
+ private String name;
/**
* Creates a mew instance, with aggregation polilcy
@@ -43,17 +43,10 @@ class ReplacingPropertySource implements PropertySource {
* @param mainMap The main ConfigMap.
* @param replacingMap The replacing ConfigMap.
*/
- public ReplacingPropertySource(MetaInfo metaInfo, PropertySource mainMap, Map<String, String> replacingMap){
+ public ReplacingPropertySource(String name, PropertySource mainMap, Map<String, String> replacingMap){
this.replacingMap = Objects.requireNonNull(replacingMap);
this.mainMap = Objects.requireNonNull(mainMap);
- if(metaInfo==null) {
- this.metaInfo = MetaInfoBuilder.of().setType("replacing").set("mainProvider", mainMap.toString())
- .set("replacing", replacingMap.toString()).build();
- }
- else{
- this.metaInfo = MetaInfoBuilder.of(metaInfo).setType("replacing").set("mainProvider", mainMap.toString())
- .set("replacing", replacingMap.toString()).build();
- }
+ this.name = Objects.requireNonNull(name);
}
@Override
@@ -62,21 +55,16 @@ class ReplacingPropertySource implements PropertySource {
}
@Override
- public boolean containsKey(String key){
- return mainMap.containsKey(key);
- }
-
- @Override
- public Map<String,String> toMap(){
+ public Map<String,String> getProperties(){
Map<String,String> result = new HashMap<>(replacingMap);
- mainMap.toMap().entrySet().stream().filter(en -> !replacingMap.containsKey(en.getKey())).forEach(en ->
+ mainMap.getProperties().entrySet().stream().filter(en -> !replacingMap.containsKey(en.getKey())).forEach(en ->
result.put(en.getKey(), en.getValue()));
return result;
}
@Override
- public MetaInfo getMetaInfo(){
- return this.metaInfo;
+ public String getName(){
+ return this.name;
}
@Override
@@ -88,11 +76,6 @@ class ReplacingPropertySource implements PropertySource {
return Optional.ofNullable(val);
}
- @Override
- public Set<String> keySet(){
- return mainMap.keySet();
- }
-
/**
* Apply a config change to this item. Hereby the change must be related to the same instance.
* @param change the config change
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/SubtractingPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/SubtractingPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/SubtractingPropertySource.java
index dc02693..748c86e 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/SubtractingPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/SubtractingPropertySource.java
@@ -32,9 +32,8 @@ class SubtractingPropertySource extends AbstractPropertySource {
private PropertySource unit;
private List<PropertySource> subtrahends;
- public SubtractingPropertySource(MetaInfo metaInfo, PropertySource configuration, List<PropertySource> subtrahends){
- super(metaInfo==null?MetaInfoBuilder.of(configuration.getMetaInfo()).setType("subtracted").build():
- MetaInfoBuilder.of(metaInfo).setType("subtracted").build());
+ public SubtractingPropertySource(String name, PropertySource configuration, List<PropertySource> subtrahends){
+ super(name);
Objects.requireNonNull(configuration);
this.unit = configuration;
this.subtrahends = new ArrayList<>(subtrahends);
@@ -42,7 +41,7 @@ class SubtractingPropertySource extends AbstractPropertySource {
private boolean filter(Map.Entry<String,String> entry){
for(PropertySource prov: subtrahends){
- if(prov.containsKey(entry.getKey())){
+ if(prov.get(entry.getKey()).isPresent()){
return false;
}
}
@@ -50,8 +49,8 @@ class SubtractingPropertySource extends AbstractPropertySource {
}
@Override
- public Map<String,String> toMap(){
- return this.unit.toMap().entrySet().stream().filter(this::filter).collect(Collectors.toMap(
+ public Map<String,String> getProperties(){
+ return this.unit.getProperties().entrySet().stream().filter(this::filter).collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue
));
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/SystemPropertiesPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/SystemPropertiesPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/SystemPropertiesPropertySource.java
index b9b3a31..f66c4f8 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/SystemPropertiesPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/SystemPropertiesPropertySource.java
@@ -18,10 +18,6 @@
*/
package org.apache.tamaya.core.properties;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.core.env.ConfiguredSystemProperties;
-import org.apache.tamaya.core.properties.AbstractPropertySource;
-
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -32,16 +28,19 @@ class SystemPropertiesPropertySource extends AbstractPropertySource {
private static final long serialVersionUID = -5935940312707001199L;
- public SystemPropertiesPropertySource(){
- super(MetaInfoBuilder.of().setType("sys-properties").build());
+ /**
+ * Constructor.
+ */
+ protected SystemPropertiesPropertySource() {
+ super("<System.getProperties()>");
}
@Override
- public Map<String,String> toMap(){
+ public Map<String,String> getProperties(){
Properties sysProps = System.getProperties();
- if(sysProps instanceof ConfiguredSystemProperties){
- sysProps = ((ConfiguredSystemProperties)sysProps).getInitialProperties();
- }
+// if(sysProps instanceof ConfiguredSystemProperties){
+// sysProps = ((ConfiguredSystemProperties)sysProps).getInitialProperties();
+// }
Map<String,String> props = new HashMap<>();
for (Map.Entry<Object,Object> en : sysProps.entrySet()) {
props.put(en.getKey().toString(), en.getValue().toString());
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/properties/URLBasedPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/properties/URLBasedPropertySource.java b/core/src/main/java/org/apache/tamaya/core/properties/URLBasedPropertySource.java
index a3ae395..8086c23 100644
--- a/core/src/main/java/org/apache/tamaya/core/properties/URLBasedPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/properties/URLBasedPropertySource.java
@@ -20,13 +20,9 @@ package org.apache.tamaya.core.properties;
import org.apache.tamaya.AggregationPolicy;
import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.MetaInfo;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.core.config.ConfigurationFormats;
import org.apache.tamaya.core.internal.resources.io.UrlResource;
-import org.apache.tamaya.core.properties.AbstractPropertySource;
import org.apache.tamaya.core.resource.Resource;
-import org.apache.tamaya.core.spi.ConfigurationFormat;
+import org.apache.tamaya.core.config.ConfigurationFormat;
import java.net.URL;
import java.util.*;
@@ -41,8 +37,8 @@ final class URLBasedPropertySource extends AbstractPropertySource {
private Map<String,String> properties = new HashMap<>();
private AggregationPolicy aggregationPolicy;
- public URLBasedPropertySource(MetaInfo metaInfo, List<URL> resources, AggregationPolicy aggregationPolicy) {
- super(metaInfo);
+ public URLBasedPropertySource(String name, List<URL> resources, AggregationPolicy aggregationPolicy) {
+ super(name);
this.resources.addAll(Objects.requireNonNull(resources));
this.aggregationPolicy = Objects.requireNonNull(aggregationPolicy);
init();
@@ -52,7 +48,7 @@ final class URLBasedPropertySource extends AbstractPropertySource {
List<String> sources = new ArrayList<>();
for(URL url : resources){
Resource res = new UrlResource(url);
- ConfigurationFormat format = ConfigurationFormats.getFormat(res);
+ ConfigurationFormat format = ConfigurationFormat.from(res);
if(format != null){
try{
Map<String, String> read = format.readConfiguration(res);
@@ -75,13 +71,13 @@ final class URLBasedPropertySource extends AbstractPropertySource {
}
}
}
- MetaInfoBuilder metaInfoBuilder = MetaInfoBuilder.of(getMetaInfo());
- metaInfo = metaInfoBuilder
- .setSources(sources.toString()).build();
+// MetaInfoBuilder metaInfoBuilder = MetaInfoBuilder.of(getMetaInfo());
+// metaInfo = metaInfoBuilder
+// .setSources(sources.toString()).build();
}
@Override
- public Map<String, String> toMap() {
+ public Map<String, String> getProperties() {
return properties;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/resource/ResourceLoader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/resource/ResourceLoader.java b/core/src/main/java/org/apache/tamaya/core/resource/ResourceLoader.java
index f4f86e9..52e6f47 100644
--- a/core/src/main/java/org/apache/tamaya/core/resource/ResourceLoader.java
+++ b/core/src/main/java/org/apache/tamaya/core/resource/ResourceLoader.java
@@ -46,7 +46,7 @@ public interface ResourceLoader{
*
* @param expressions the expressions to be resolved, not empty.
* @return the corresponding collection current {@link java.net.URI}s defining the
- * concrete resources to be read by a {@link org.apache.tamaya.core.spi.ConfigurationFormat}
+ * concrete resources to be read by a {@link org.apache.tamaya.core.config.ConfigurationFormat}
* .
*/
List<Resource> getResources(String... expressions);
@@ -56,7 +56,7 @@ public interface ResourceLoader{
*
* @param expressions the expressions to be resolved, not empty.
* @return the corresponding collection current {@link java.net.URI}s defining the
- * concrete resources to be read by a {@link org.apache.tamaya.core.spi.ConfigurationFormat}
+ * concrete resources to be read by a {@link org.apache.tamaya.core.config.ConfigurationFormat}
* .
*/
List<Resource> getResources(Collection<String> expressions);
@@ -66,7 +66,7 @@ public interface ResourceLoader{
*
* @param expressions the expressions to be resolved, not empty.
* @return the corresponding collection current {@link java.net.URI}s defining the
- * concrete resources to be read by a {@link org.apache.tamaya.core.spi.ConfigurationFormat}
+ * concrete resources to be read by a {@link org.apache.tamaya.core.config.ConfigurationFormat}
* .
*/
List<Resource> getResources(ClassLoader classLoader, String... expressions);
@@ -76,7 +76,7 @@ public interface ResourceLoader{
*
* @param expressions the expressions to be resolved, not empty.
* @return the corresponding collection current {@link java.net.URI}s defining the
- * concrete resources to be read by a {@link org.apache.tamaya.core.spi.ConfigurationFormat}
+ * concrete resources to be read by a {@link org.apache.tamaya.core.config.ConfigurationFormat}
* .
*/
List<Resource> getResources(ClassLoader classLoader, Collection<String> expressions);
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/AdapterProviderSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/AdapterProviderSpi.java b/core/src/main/java/org/apache/tamaya/core/spi/AdapterProviderSpi.java
deleted file mode 100644
index 6cb6dc1..0000000
--- a/core/src/main/java/org/apache/tamaya/core/spi/AdapterProviderSpi.java
+++ /dev/null
@@ -1,36 +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.spi;
-
-import org.apache.tamaya.Codec;
-
-/**
- * This service provides different {@link org.apache.tamaya.Codec} instances for types.
- */
-public interface AdapterProviderSpi{
-
- /**
- * Called, when a given {@link org.apache.tamaya.Configuration} has to be evaluated.
- *
- * @return the corresponding {@link java.util.function.Function<String, T>}, or {@code null}, if
- * not available for the given target type.
- */
- <T> Codec<T> getAdapter(Class<T> type);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/CodecProviderSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/CodecProviderSpi.java b/core/src/main/java/org/apache/tamaya/core/spi/CodecProviderSpi.java
new file mode 100644
index 0000000..b814037
--- /dev/null
+++ b/core/src/main/java/org/apache/tamaya/core/spi/CodecProviderSpi.java
@@ -0,0 +1,36 @@
+/*
+ * 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.spi;
+
+import org.apache.tamaya.Codec;
+
+/**
+ * This service provides different {@link org.apache.tamaya.Codec} instances for types.
+ */
+public interface CodecProviderSpi {
+
+ /**
+ * Called, when a given {@link org.apache.tamaya.Configuration} has to be evaluated.
+ *
+ * @return the corresponding {@link java.util.function.Function<String, T>}, or {@code null}, if
+ * not available for the given target type.
+ */
+ <T> Codec<T> getCodec(Class<T> type);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormat.java b/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormat.java
deleted file mode 100644
index cc60905..0000000
--- a/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormat.java
+++ /dev/null
@@ -1,57 +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.spi;
-
-import org.apache.tamaya.core.resource.Resource;
-
-import java.util.Map;
-
-/**
- * Implementations current this class encapsulate the mechanism how to read a
- * resource URI including interpreting the format correctly (e.g. xml vs.
- * properties).
- */
-public interface ConfigurationFormat{
-
- /**
- * Returns a unique identifier that identifies each format.
- *
- * @return the unique format id, mever null.
- */
- public String getFormatName();
-
- /**
- * Check if the given {@link java.net.URI} and path xpression qualify that this format should be
- * able to read them, e.g. checking for compatible file endings.
- *
- * @param resource the configuration location, not null
- * @return {@code true} if the given resource is in a format supported by
- * this instance.
- */
- boolean isAccepted(Resource resource);
-
- /**
- * Reads a {@link org.apache.tamaya.PropertySource} fromMap the given URI, using this format.
- *
- * @param resource the configuration location, not null
- * @return the corresponding {@link java.util.Map}, never {@code null}.
- */
- Map<String,String> readConfiguration(Resource resource);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatSpi.java b/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatSpi.java
new file mode 100644
index 0000000..7df988b
--- /dev/null
+++ b/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatSpi.java
@@ -0,0 +1,61 @@
+/*
+ * 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.spi;
+
+import org.apache.tamaya.core.config.ConfigurationFormat;
+import org.apache.tamaya.core.resource.Resource;
+
+import java.util.Collection;
+
+/**
+ * Created by Anatole on 17.09.2014.
+ */
+public interface ConfigurationFormatSpi {
+ /**
+ * Access a {@link org.apache.tamaya.core.config.ConfigurationFormat}.
+ *
+ * @param formatName the format name
+ * @return the corresponding {@link org.apache.tamaya.core.config.ConfigurationFormat}, or {@code null}, if
+ * not available for the given environment.
+ */
+ ConfigurationFormat getFormat(String formatName);
+
+ /**
+ * Get a collection current the keys current the registered {@link org.apache.tamaya.core.config.ConfigurationFormat} instances.
+ *
+ * @return a collection current the keys current the registered {@link ConfigurationFormat} instances.
+ */
+ Collection<String> getFormatNames();
+
+ /**
+ * Evaluate the matching format for a given resource.
+ *
+ * @param resource The resource
+ * @return a matching configuration format, or {@code null} if no matching format could be determined.
+ */
+ ConfigurationFormat getFormat(Resource resource);
+
+ default ConfigurationFormat getPropertiesFormat(){
+ return getFormat("properties");
+ }
+
+ default ConfigurationFormat getXmlPropertiesFormat(){
+ return getFormat("xml-properties");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatsSingletonSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatsSingletonSpi.java b/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatsSingletonSpi.java
deleted file mode 100644
index 260f945..0000000
--- a/core/src/main/java/org/apache/tamaya/core/spi/ConfigurationFormatsSingletonSpi.java
+++ /dev/null
@@ -1,60 +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.spi;
-
-import org.apache.tamaya.core.resource.Resource;
-
-import java.util.Collection;
-
-/**
- * Created by Anatole on 17.09.2014.
- */
-public interface ConfigurationFormatsSingletonSpi{
- /**
- * Access a {@link org.apache.tamaya.core.spi.ConfigurationFormat}.
- *
- * @param formatName the format name
- * @return the corresponding {@link org.apache.tamaya.core.spi.ConfigurationFormat}, or {@code null}, if
- * not available for the given environment.
- */
- ConfigurationFormat getFormat(String formatName);
-
- /**
- * Get a collection current the keys current the registered {@link ConfigurationFormat} instances.
- *
- * @return a collection current the keys current the registered {@link ConfigurationFormat} instances.
- */
- Collection<String> getFormatNames();
-
- /**
- * Evaluate the matching format for a given resource.
- *
- * @param resource The resource
- * @return a matching configuration format, or {@code null} if no matching format could be determined.
- */
- ConfigurationFormat getFormat(Resource resource);
-
- default ConfigurationFormat getPropertiesFormat(){
- return getFormat("properties");
- }
-
- default ConfigurationFormat getXmlPropertiesFormat(){
- return getFormat("xml-properties");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/EnvironmentProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/EnvironmentProvider.java b/core/src/main/java/org/apache/tamaya/core/spi/EnvironmentProvider.java
deleted file mode 100644
index 3696db9..0000000
--- a/core/src/main/java/org/apache/tamaya/core/spi/EnvironmentProvider.java
+++ /dev/null
@@ -1,46 +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.spi;
-
-import java.util.Map;
-
-import org.apache.tamaya.Environment;
-
-/**
- * SPI for components that define a concrete type current {@link org.apache.tamaya.Environment}.
- * The chain current environment config determine the current {@link Environment} active
- * and its parent instances.
- * Created by Anatole on 14.10.2014.
- */
-public interface EnvironmentProvider {
-
- /**
- * Evaluates if an environment is currently active.
- * @return
- */
- boolean isActive();
-
- /**
- * Returns the properties to be added to the environment.
- * @return the properties, or an empty map if no properties are to be added (or the provider is not active for the
- * current runtime state).
- */
- Map<String,String> getEnvironmentData();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorService.java b/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorService.java
deleted file mode 100644
index e26aa07..0000000
--- a/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorService.java
+++ /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 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.spi;
-
-
-import org.apache.tamaya.Configuration;
-
-/**
- * Service used for resolving configuration annotations.
- */
-public interface ObjectConfiguratorService{
-
- /**
- * Inject fields annotated for configuration.
- *
- * @param instance
- * The instance to be configured.
- */
- void configure(Object instance, Configuration configuration);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorSpi.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorSpi.java b/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorSpi.java
new file mode 100644
index 0000000..9f38792
--- /dev/null
+++ b/core/src/main/java/org/apache/tamaya/core/spi/ObjectConfiguratorSpi.java
@@ -0,0 +1,37 @@
+/*
+ * 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.spi;
+
+
+import org.apache.tamaya.Configuration;
+
+/**
+ * Service used for resolving configuration annotations.
+ */
+public interface ObjectConfiguratorSpi {
+
+ /**
+ * Inject fields annotated for configuration.
+ *
+ * @param instance
+ * The instance to be configured.
+ */
+ void configure(Object instance, Configuration configuration);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/java/org/apache/tamaya/core/spi/PropertyAdapterService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/spi/PropertyAdapterService.java b/core/src/main/java/org/apache/tamaya/core/spi/PropertyAdapterService.java
index 199f5a9..9270636 100644
--- a/core/src/main/java/org/apache/tamaya/core/spi/PropertyAdapterService.java
+++ b/core/src/main/java/org/apache/tamaya/core/spi/PropertyAdapterService.java
@@ -1,64 +1,64 @@
-/*
- * 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.spi;
-
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tamaya.Codec;
-
-@SuppressWarnings("unchecked")
-public interface PropertyAdapterService{
-
- public default Codec<URL> getURLAdapter(){
- return Codec.class.cast(getClassAdapter(URL.class));
- }
-
- public default Codec<InputStream> getClasspathResourceAdapter(){
- return Codec.class.cast(getClassAdapter(InputStream.class));
- }
-
- public default Codec<File> getFileAdapter(){
- return Codec.class.cast(getClassAdapter(File.class));
- }
-
- public default Codec<Set<String>> getSetAdapter(){
- return Codec.class.cast(getClassAdapter(Set.class));
- }
-
- public default Codec<Map<String, String>> getMapAdapter(){
- return Codec.class.cast(getClassAdapter(Map.class));
- }
-
- public default Codec<List<String>> getListAdapter(){
- return Codec.class.cast(getClassAdapter(List.class));
- }
-
- public default <T> Codec<Class<? extends T>> getClassAdapter(Class<T> requiredType){
- return getClassAdapter(requiredType, Thread.currentThread().getContextClassLoader());
- }
-
- public <T> Codec<Class<? extends T>> getClassAdapter(Class<T> requiredType,
- ClassLoader... classLoaders);
-
-}
+///*
+// * 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.spi;
+//
+//import java.io.File;
+//import java.io.InputStream;
+//import java.net.URL;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.Set;
+//
+//import org.apache.tamaya.Codec;
+//
+//@SuppressWarnings("unchecked")
+//public interface PropertyAdapterService{
+//
+// public default Codec<URL> getURLAdapter(){
+// return Codec.class.cast(getClassAdapter(URL.class));
+// }
+//
+// public default Codec<InputStream> getClasspathResourceAdapter(){
+// return Codec.class.cast(getClassAdapter(InputStream.class));
+// }
+//
+// public default Codec<File> getFileAdapter(){
+// return Codec.class.cast(getClassAdapter(File.class));
+// }
+//
+// public default Codec<Set<String>> getSetAdapter(){
+// return Codec.class.cast(getClassAdapter(Set.class));
+// }
+//
+// public default Codec<Map<String, String>> getMapAdapter(){
+// return Codec.class.cast(getClassAdapter(Map.class));
+// }
+//
+// public default Codec<List<String>> getListAdapter(){
+// return Codec.class.cast(getClassAdapter(List.class));
+// }
+//
+// public default <T> Codec<Class<? extends T>> getClassAdapter(Class<T> requiredType){
+// return getClassAdapter(requiredType, Thread.currentThread().getContextClassLoader());
+// }
+//
+// public <T> Codec<Class<? extends T>> getClassAdapter(Class<T> requiredType,
+// ClassLoader... classLoaders);
+//
+//}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/java-config-1.0.0.xsd
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/java-config-1.0.0.xsd b/core/src/main/resources/META-INF/java-config-1.0.0.xsd
deleted file mode 100644
index fa917a0..0000000
--- a/core/src/main/resources/META-INF/java-config-1.0.0.xsd
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java-config.java.net/metamodel/1.0.0"
- xmlns:tns="http://java-config.java.net/metamodel/1.0.0"
- elementFormDefault="qualified">
-
- <element name="java-config">
- <complexType>
- <sequence>
- <element name="metaModel" minOccurs="1" maxOccurs="1">
- <complexType>
- <sequence>
- <element name="configParts">
- <complexType>
- <sequence>
- <element name="configPart" type="tns:configPart" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- </sequence>
- <attribute name="id" type="string"></attribute>
- </complexType>
- </element>
- </sequence>
- </complexType>
- </element>
-
- <complexType name="configPart">
- <sequence>
- <sequence>
- <element name="properties" type="tns:properties"></element>
- </sequence>
- <sequence>
- <element name="childParts" type="tns:childParts"></element>
- </sequence>
- </sequence>
- <attribute name="key" type="string"></attribute>
- <attribute name="partType" type="string"></attribute>
- <attribute name="propertyMapSpec" type="string"></attribute>
- </complexType>
-
- <complexType name="properties">
- <sequence>
- <element name="comment" type="tns:entry"></element>
- <element name="entry" type="tns:entry"></element>
- </sequence>
- </complexType>
- <complexType name="entry">
- <attribute name="key" type="string"></attribute>
- </complexType>
-
- <complexType name="childParts">
- <sequence>
- <element name="childPart" type="tns:entry">
- <complexType>
- <attribute name="psrtType" type="string"></attribute>
- <attribute name="keyRef" type="string"></attribute>
- </complexType>
- </element>
- </sequence>
- </complexType>
-
-</schema>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/java-config.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/java-config.xml b/core/src/main/resources/META-INF/java-config.xml
deleted file mode 100644
index 329f0e6..0000000
--- a/core/src/main/resources/META-INF/java-config.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<java-config xmlns="http://java.net/projects/javaconfig/java-config/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="java-config-1.0.0.xsd">
- <metaModel id="default">
- <configParts>
- <configPart key="sys-properties" partType="javax.config.PropertyMap" propertyMapSpec="org.apache.tamaya.core.properties.SystemPropertiesPropertyMap"/>
- <configPart key="env-properties" partType="javax.config.PropertyMap" propertyMapSpec="org.apache.tamaya.core.properties.EnvironmentPropertyMap"/>
- <configPart key="--system--" partType="org.apache.tamaya.Configuration" propertyMapSpec="union">
- <childPart partType="javax.config.PropertyMap" keyRef="sys-properties"/>
- <childPart partType="javax.config.PropertyMap" keyRef="env-properties"/>
- </configPart>
- </configParts>
- </metaModel>
-</java-config>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/meta-model.properties
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/meta-model.properties b/core/src/main/resources/META-INF/meta-model.properties
deleted file mode 100644
index dcfc41f..0000000
--- a/core/src/main/resources/META-INF/meta-model.properties
+++ /dev/null
@@ -1,39 +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.
-#
-
-## Register default configuration formats
-format.xml-properties.spec=org.apache.tamaya.org.apache.tamaya.internal.format.PropertiesXmlFormat
-format.properties.spec=org.apache.tamaya.org.apache.tamaya.internal.format.PropertiesFormat
-
-## Define default readers (reading sources)
-reader.classpath.spec=org.apache.tamaya.core.internal.properties.ClasspathPropertyProvider
-reader.file.spec=org.apache.tamaya.core.properties.FilePropertyMap
-
-## Define property maps
-propertymap.environment.spec=union
-propertymap.environment.policy=override
-propertymap.environment.content=env-props[/env],sys-props[/sys],cli[/cli],network[/net]
-propertymap.env-props.spec=org.apache.tamaya.core.properties.EnvironmentPropertyMap
-propertymap.sys-props.spec=org.apache.tamaya.core.properties.SystemPropertiesPropertyMap
-propertymap.network.spec=org.apache.tamaya.core.properties.NetworkPropertyMap
-propertymap.cli.spec=org.apache.tamaya.core.properties.CLIPropertyMap
-
-## Define root configurations
-configuration.default.content=environment[/]
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/services/org.apache.tamaya.core.config.ConfigurationFormat
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.config.ConfigurationFormat b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.config.ConfigurationFormat
new file mode 100644
index 0000000..7aa2407
--- /dev/null
+++ b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.config.ConfigurationFormat
@@ -0,0 +1,21 @@
+#
+# 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.core.internal.format.PropertiesFormat
+org.apache.tamaya.core.internal.format.PropertiesXmlFormat
+org.apache.tamaya.core.internal.format.IniFormat
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resource.ResourceLoader
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resource.ResourceLoader b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resource.ResourceLoader
index f9c0de4..c245d54 100644
--- a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resource.ResourceLoader
+++ b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resource.ResourceLoader
@@ -16,5 +16,5 @@
# specific language governing permissions and limitations
# under the License.
#
-org.apache.tamaya.core.internal.resources.DefaultPathResourceLoader
+org.apache.tamaya.core.internal.resources.DefaultResourceLoader
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormat
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormat b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormat
deleted file mode 100644
index 7aa2407..0000000
--- a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormat
+++ /dev/null
@@ -1,21 +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.core.internal.format.PropertiesFormat
-org.apache.tamaya.core.internal.format.PropertiesXmlFormat
-org.apache.tamaya.core.internal.format.IniFormat
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatSpi
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatSpi b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatSpi
new file mode 100644
index 0000000..e81bd2b
--- /dev/null
+++ b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatSpi
@@ -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.core.internal.format.DefaultConfigurationFormatSpi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a3c10d6e/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatsSingletonSpi
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatsSingletonSpi b/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatsSingletonSpi
deleted file mode 100644
index f4f2aa1..0000000
--- a/core/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationFormatsSingletonSpi
+++ /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.core.internal.format.DefaultConfigFormatsSingletonSpi
\ No newline at end of file