You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by st...@apache.org on 2014/12/27 14:58:02 UTC
[18/34] incubator-tamaya git commit: first step: move all sources to
a 'dormant' directory
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/PropertyAdapter.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/PropertyAdapter.java b/dormant/api/src/main/java/org/apache/tamaya/PropertyAdapter.java
new file mode 100644
index 0000000..5cecd09
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/PropertyAdapter.java
@@ -0,0 +1,89 @@
+/*
+ * 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;
+
+
+import org.apache.tamaya.annotation.WithPropertyAdapter;
+import org.apache.tamaya.spi.PropertyAdapterSpi;
+import org.apache.tamaya.spi.ServiceContext;
+
+/**
+ * Interface for an property that converts a configured String into something else.
+ * This is used for implementing type conversion from a property (String) to a certain target
+ * type. Hereby the target type can be multivalued (eg eollections), complex or even contain
+ * full subconfigurations, if needed.
+ */
+@FunctionalInterface
+public interface PropertyAdapter<T>{
+
+ /**
+ * Adapt the given configuration keys to the required target type.
+ * @param value the configuration keys
+ * @return adapted keys
+ */
+ T adapt(String value);
+
+
+ /**
+ * Registers a new PropertyAdapter for the given target type, hereby replacing any existing adapter for
+ * this type.
+ * @param targetType The target class, not null.
+ * @param adapter The adapter, not null.
+ * @param <T> The target type
+ * @return any adapter replaced with the new adapter, or null.
+ */
+ public static <T> PropertyAdapter<T> register(Class<T> targetType, PropertyAdapter<T> adapter){
+ return ServiceContext.getInstance().getSingleton(PropertyAdapterSpi.class).register(targetType, adapter);
+ }
+
+ /**
+ * Get an adapter converting to the given target type.
+ * @param targetType the target type class
+ * @return true, if the given target type is supported.
+ */
+ public static boolean isTargetTypeSupported(Class<?> targetType){
+ return ServiceContext.getInstance().getSingleton(PropertyAdapterSpi.class).isTargetTypeSupported(targetType);
+ }
+
+ /**
+ * Get an adapter converting to the given target type.
+ * @param targetType the target type class
+ * @param <T> the target type
+ * @return the corresponding adapter, never null.
+ * @throws org.apache.tamaya.ConfigException if the target type is not supported.
+ */
+ public static <T> PropertyAdapter<T> getInstance(Class<T> targetType){
+ return ServiceContext.getInstance().getSingleton(PropertyAdapterSpi.class).getPropertyAdapter(targetType, null);
+ }
+
+ /**
+ * Get an adapter converting to the given target type.
+ * @param targetType the target type class
+ * @param annotation the {@link org.apache.tamaya.annotation.WithPropertyAdapter} annotation, or null. If the annotation is not null and
+ * defines an overriding adapter, this instance is created and returned.
+ * @param <T> the target type
+ * @return the corresponding adapter, never null.
+ * @throws org.apache.tamaya.ConfigException if the target type is not supported, or the overriding adapter cannot be
+ * instantiated.
+ */
+ public static <T> PropertyAdapter<T> getInstance(Class<T> targetType, WithPropertyAdapter annotation){
+ return ServiceContext.getInstance().getSingleton(PropertyAdapterSpi.class).getPropertyAdapter(targetType, annotation);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/PropertySource.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/PropertySource.java b/dormant/api/src/main/java/org/apache/tamaya/PropertySource.java
new file mode 100644
index 0000000..f4b01ae
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/PropertySource.java
@@ -0,0 +1,129 @@
+/*
+* 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;
+
+import java.util.*;
+import java.util.function.Function;
+import java.util.function.UnaryOperator;
+
+/**
+ * This interface models a provider that serves configuration properties. The contained
+ * properties may be read fromMap single or several sources (composite).<br/>
+ * Property config are the building blocks out current which complex
+ * configuration is setup.
+ * <p/>
+ * <h3>Implementation Requirements</h3>
+ * <p></p>Implementations current this interface must be
+ * <ul>
+ * <li>Thread safe.
+ * </ul>
+ * It is highly recommended that implementations also are
+ * <ul>
+ * <li>Immutable</li>
+ * <li>serializable</li>
+ * </ul>
+ * </p>
+ */
+public interface PropertySource extends PropertyMapSupplier {
+
+ /**
+ * An empty and immutable PropertyProvider instance.
+ */
+ public static final PropertySource EMPTY_PROPERTYSOURCE = new PropertySource() {
+
+ @Override
+ public String getName() {
+ return "<empty>";
+ }
+
+ @Override
+ public Optional<String> get(String key) {
+ return Optional.empty();
+ }
+
+ @Override
+ public Map<String, String> getProperties() {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public String toString(){
+ return "PropertySource [name=<empty>]";
+ }
+ };
+
+ /**
+ * Get the name of the property source. The name should be unique for the type of source, whereas the id is used
+ * to ensure unique identity, either locally or remotely.
+ * @return the configuration's name, never null.
+ */
+ String getName();
+
+ /**
+ * Access a property.
+ *
+ * @param key the property's key, not null.
+ * @return the property's keys.
+ */
+ Optional<String> get(String key);
+
+ /**
+ * Determines if this config source should be scanned for its list of properties.
+ *
+ * Generally, slow ConfigSources should return false here.
+ *
+ * @return true if this ConfigSource should be scanned for its list of properties,
+ * false if it should not be scanned.
+ */
+ default boolean isScannable(){
+ return true;
+ }
+
+ /**
+ * Allows to quickly check, if a provider is empty.
+ *
+ * @return true, if the provier is empty.
+ */
+ default boolean isEmpty() {
+ return getProperties().isEmpty();
+ }
+
+ /**
+ * Extension point for adjusting property sources.
+ *
+ * @param operator A property source operator, e.g. a filter, or an adjuster
+ * combining property sources.
+ * @return the new adjusted property source, never {@code null}.
+ */
+ default PropertySource with(UnaryOperator<PropertySource> operator){
+ return operator.apply(this);
+ }
+
+ /**
+ * Query something from a property source.
+ *
+ * @param query the query, never {@code null}.
+ * @return the result
+ */
+ default <T> T query(Function<PropertySource, T> query){
+ return query.apply(this);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperties.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperties.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperties.java
new file mode 100644
index 0000000..e1d773d
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperties.java
@@ -0,0 +1,41 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation container to enable injection current multiple {@link org.apache.tamaya.annotation.ConfiguredProperty}
+ * annotations. Hereby the ordering current annotations imply the defaulting. The first keys that
+ * could be resolved successfully in the chain current annotations will be used.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD })
+public @interface ConfiguredProperties {
+
+ /**
+ * Get the different configuration keys to be looked up, in order current precedence. The first non null keys
+ * found will be used.
+ */
+ ConfiguredProperty[] value() default {};
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperty.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperty.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperty.java
new file mode 100644
index 0000000..21d4e3a
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/ConfiguredProperty.java
@@ -0,0 +1,87 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * Annotation to enable injection current a configured property or define the returned data for
+ * a configuration template method. Hereby this annotation can be used in multiple ways and combined
+ * with other annotations such as {@link org.apache.tamaya.annotation.DefaultValue},
+ * {@link org.apache.tamaya.annotation.WithLoadPolicy}, {@link org.apache.tamaya.annotation.WithConfig},
+ * {@link org.apache.tamaya.annotation.WithConfigOperator}, {@link WithPropertyAdapter}.
+ *
+ * Below the most simple variant current a configured class is given:
+ * {@code
+ * pubic class ConfiguredItem{
+ *
+ * @ConfiguredProperty
+ * private String aValue;
+ * }
+ * When this class is configured, e.g. by passing it to {@link org.apache.tamaya.Configuration#configure(Object)},
+ * the following is happening:
+ * <ul>
+ * <li>The current valid Configuration is evaluated by calling {@code Configuration cfg = Configuration.current();}</li>
+ * <li>The current property String keys is evaluated by calling {@code cfg.get("aValue");}</li>
+ * <li>if not successful, an error is thrown ({@link org.apache.tamaya.ConfigException}.</li>
+ * <li>On success, since no type conversion is involved, the keys is injected.</li>
+ * <li>The configured bean is registered as a weak change listener in the config system's underlying
+ * configuration, so future config changes can be propagated (controlled by {@link org.apache.tamaya.annotation.WithLoadPolicy}
+ * annotations).</li>
+ * </ul>
+ *
+ * In the next example we explicitly define the property keys:
+ * {@code
+ * pubic class ConfiguredItem{
+ *
+ * @ConfiguredProperty
+ * @ConfiguredProperty({"a.b.value", "a.b.deprecated.keys", "${env:java.version}"})
+ * @ConfiguredProperty(configuration={"a", "b"}
+ * @ConfiguredProperty(configuration={"a", "b", keys={"a.b.keys", "a.b.deprecated.keys", "${env:java.version}"}}
+ * private String aValue;
+ * }
+ *
+ * Within this example we evaluate multiple possible keys. Evaluation is aborted if a key could be successfully
+ * resolved. Hereby the ordering current the annotations define the ordering current resolution, so in the example above
+ * resolution equals to {@code "aValue", "a.b.keys", "a.b.deprecated.keys"}. If no keys could be read
+ * fromMap the configuration, it uses the keys fromMap the {@code DefaultValue} annotation. Interesting here
+ * is that this keys is not static, it is evaluated by calling
+ * {@link org.apache.tamaya.Configuration#evaluateValue(String, org.apache.tamaya.Configuration...)}.
+ */
+@Repeatable(ConfiguredProperties.class)
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD })
+public @interface ConfiguredProperty {
+
+ /**
+ * Annotation to reference an explicit {@link org.apache.tamaya.Configuration} to be used to
+ * resolve the required properties. the configured keys is passed to {@code Configuration.current(String)}
+ * to evaluate the required configuration required.
+ * @return the configurations to be looked up for the given keys.
+ */
+ String config() default "";
+
+ /**
+ * Get the property names to be used. Hereby the first non null keys evaluated is injected as property keys.
+ *
+ * @return the property names, not null. If missing the field or method name being injected is used by default.
+ */
+ String[] keys() default {};
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultAreas.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultAreas.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultAreas.java
new file mode 100644
index 0000000..63ea137
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultAreas.java
@@ -0,0 +1,43 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation to control injection and resolution current a configured bean. The configuration keys
+ * to be resolved are basically determined by the {@link org.apache.tamaya.annotation.ConfiguredProperty}
+ * annotation(s). Nevertheless these annotations can also have relative key names. This annotation allows
+ * to define a configuration area that is prefixed to all relative configuration keys within the
+ * corresponding class/template interface.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+public @interface DefaultAreas {
+
+ /**
+ * Allows to declare an operator that should be applied before injecting values into the bean.
+ * @return the operator class to be used.
+ */
+ String[] value();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultValue.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultValue.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultValue.java
new file mode 100644
index 0000000..c4b2e3a
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/DefaultValue.java
@@ -0,0 +1,41 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation to define a default keys to be returned, when no configured keys could be
+ * determined for a property/template accessor. The keys hereby can also contain a
+ * dynamic expression that is evaluated by the configuration system.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD })
+public @interface DefaultValue {
+
+ /**
+ * The default keys to be injected, if no such configuration entry was found. If keys was found and no default
+ * is defined, it is handled as a deployment error.
+ */
+ String value() default "";
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/LoadPolicy.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/LoadPolicy.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/LoadPolicy.java
new file mode 100644
index 0000000..116a2c1
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/LoadPolicy.java
@@ -0,0 +1,48 @@
+/*
+ * 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.annotation;
+
+/**
+ * Available policies that describe how changes affecting configured values are published/reinjected.
+ * The policy also affects the cases were any configured listeners/listener methods are called for
+ * propagation current configuration changes.
+ */
+public enum LoadPolicy {
+ /**
+ * The configuration keys is evaluated once, when the owning component is loaded/configured, but never updated later.
+ */
+ INITIAL,
+ /**
+ * The configuration keys is evaluated exactly once on its first use lazily, but never updated later.
+ * This feature is not applicable on field injection, but only on configuration template methods.
+ */
+ LAZY,
+ /**
+ * The configuration keys is evaluated once, when the owning component is loaded/configured.
+ * Later changes on this configuration entry will be reinjected/updated and additionally triggered
+ * as {@link java.beans.PropertyChangeEvent}.
+ */
+ MANAGED,
+ /**
+ * The configuration keys is evaluated once, when the owning component is loaded/configured.
+ * Later changes on this configuration entry will be reinjected/updated, but no {@link java.beans.PropertyChangeEvent}
+ * will be triggered.
+ */
+ SILENT
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/NoConfig.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/NoConfig.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/NoConfig.java
new file mode 100644
index 0000000..845ec4c
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/NoConfig.java
@@ -0,0 +1,32 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * This is a small marker annotations to inform Tamaya that the annotated element should never be injected with
+ * configured data. This is useful because by default Tamaya tries to lookup and inject configuration also by
+ * using property or method names without annotations. With that annotation none of these will be happen.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD })
+public @interface NoConfig {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/ObservesConfigChange.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/ObservesConfigChange.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/ObservesConfigChange.java
new file mode 100644
index 0000000..ef92b25
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/ObservesConfigChange.java
@@ -0,0 +1,38 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation to annotate a method on a class to be informed on config changes.
+ * The exact behaviour, when configuration change events are sent can be configured
+ * on each configured property/method by adding the {@link org.apache.tamaya.annotation.WithLoadPolicy}
+ * annotation. By default listeners are informed on all changes of configurations that were used as
+ * input configurations for configuring a class/instance. Additionally {@link org.apache.tamaya.annotation.ConfiguredProperty}
+ * annotations can be added that allows to constrain changes to some limited properties.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.METHOD })
+public @interface ObservesConfigChange {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/WithConfigOperator.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/WithConfigOperator.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithConfigOperator.java
new file mode 100644
index 0000000..9f6c4f5
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithConfigOperator.java
@@ -0,0 +1,45 @@
+/*
+ * 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.annotation;
+
+import org.apache.tamaya.Configuration;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.function.UnaryOperator;
+
+/**
+ * Annotation to define an configuration operator to be used before accessing a configured keys.
+ * This allows filtering current configuration, e.g. for realizing views or ensuring security
+ * constraints.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
+public @interface WithConfigOperator {
+
+ /**
+ * Define a custom adapter that should be used to adapt the configuration entry injected. This overrides any
+ * general org.apache.tamaya.core.internal registered. If no adapter is defined (default) and no corresponding adapter is
+ * registered, it is handled as a deployment error.
+ */
+ Class<? extends UnaryOperator<Configuration>> value();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/WithLoadPolicy.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/WithLoadPolicy.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithLoadPolicy.java
new file mode 100644
index 0000000..e469f5a
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithLoadPolicy.java
@@ -0,0 +1,40 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation to define how config changes are handled for a type or per property/template method.
+ * @see org.apache.tamaya.annotation.LoadPolicy
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
+public @interface WithLoadPolicy {
+
+ /**
+ * The load policy to be used. If this annotation is present a load policy must be defined.
+ * @return The load policy to be used, not null.
+ */
+ LoadPolicy value();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/annotation/WithPropertyAdapter.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/annotation/WithPropertyAdapter.java b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithPropertyAdapter.java
new file mode 100644
index 0000000..fa9cfdf
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/annotation/WithPropertyAdapter.java
@@ -0,0 +1,45 @@
+/*
+ * 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.annotation;
+
+import org.apache.tamaya.PropertyAdapter;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation to define a type adapter to be used before injecting a configured keys, or for applying changes.
+ * This will override any other adapter for performing the type conversion before
+ * injecting the field keys.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.FIELD, ElementType.METHOD })
+public @interface WithPropertyAdapter {
+
+ /**
+ * Define a custom adapter or codec that should be used to adapt the configuration entry injected. This overrides any
+ * general org.apache.tamaya.core.internal registered. If no adapter is defined (default) and no corresponding adapter is
+ * registered, it is handled as a deployment error.
+ */
+ @SuppressWarnings("rawtypes")
+ Class<? extends PropertyAdapter> value();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/spi/ConfigurationSpi.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/spi/ConfigurationSpi.java b/dormant/api/src/main/java/org/apache/tamaya/spi/ConfigurationSpi.java
new file mode 100644
index 0000000..5891dc2
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/spi/ConfigurationSpi.java
@@ -0,0 +1,98 @@
+/*
+ * 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.spi;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.PropertyAdapter;
+import org.apache.tamaya.PropertySource;
+import org.apache.tamaya.annotation.WithPropertyAdapter;
+
+import java.util.Map;
+import java.util.Optional;
+
+
+/**
+ * Manager for {@link org.apache.tamaya.Configuration} instances. Implementations must register an instance
+ * using the {@link ServiceContextManager} mechanism in place (by default this is based on the {@link java.util.ServiceLoader}.
+ * The {@link org.apache.tamaya.Configuration} Singleton in the API delegates its corresponding calls to the
+ * instance returned by the current bootstrap service in place.
+ *
+ * @see org.apache.tamaya.Configuration
+ * @see ServiceContextManager
+ */
+public interface ConfigurationSpi {
+
+ /**
+ * Allows to check if a configuration with a given name is defined.
+ * @param name the configuration's name, not null, not empty.
+ * @return true, if such a configuration is defined.
+ */
+ boolean isConfigurationAvailable(String name);
+
+ /**
+ * Access a configuration by name.
+ * @param name the configuration's name, not null, not empty.
+ * @return the corresponding Configuration instance, never null.
+ * @throws org.apache.tamaya.ConfigException if no such configuration is defined.
+ */
+ Configuration getConfiguration(String name);
+
+ /**
+ * Access the default configuration.
+ * @return the corresponding Configuration instance, never null.
+ * @throws org.apache.tamaya.ConfigException if no such configuration is defined.
+ */
+ default Configuration getConfiguration(){
+ return getConfiguration("default");
+ }
+
+ /**
+ * Configures an instance, by resolving and injecting the configuration
+ * entries.
+ *
+ * @param instance the instance with configuration annotations, not null.
+ * @param configurations overriding configurations to be used for evaluating the values for injection into {@code instance}.
+ * If no such config is passed, the default configurationa provided by the current
+ * registered providers are used.
+ * @throws org.apache.tamaya.ConfigException if any required configuration could not be resolved/injected.
+ */
+ void configure(Object instance, Configuration... configurations);
+
+ /**
+ * Access a configuration by name.
+ *
+ * @param configurations overriding configurations to be used for evaluating the values for injection into {@code instance}, not null.
+ * If no such config is passed, the default configurationa provided by the current
+ * registered providers are used.
+ * @return the corresponding Configuration instance, never null.
+ * @throws org.apache.tamaya.ConfigException if no such configuration is defined.
+ */
+ <T> T createTemplate(Class<T> template, Configuration... configurations);
+
+ /**
+ * Evaluate the current expression based on the current configuration valid.
+ * @param configurations overriding configurations to be used for evaluating the values for injection into {@code instance}, not null.
+ * If no such config is passed, the default configurationa provided by the current
+ * registered providers are used.
+ * @param expression the expression, not null.
+ * @return the evaluated config expression.
+ */
+ String evaluateValue(String expression, Configuration... configurations);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/spi/DefaultServiceContextProvider.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/spi/DefaultServiceContextProvider.java b/dormant/api/src/main/java/org/apache/tamaya/spi/DefaultServiceContextProvider.java
new file mode 100644
index 0000000..e1d1740
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/spi/DefaultServiceContextProvider.java
@@ -0,0 +1,101 @@
+/*
+ * 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.spi;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This class implements the (default) {@link ServiceContext} interface and hereby uses the JDK
+ * {@link java.util.ServiceLoader} to load the services required.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+class DefaultServiceContextProvider implements ServiceContext {
+ /** List current services loaded, per class. */
+ private final ConcurrentHashMap<Class, List<Object>> servicesLoaded = new ConcurrentHashMap<>();
+ /** Singletons. */
+ private final ConcurrentHashMap<Class, Optional<?>> singletons = new ConcurrentHashMap<>();
+
+ @Override
+ public <T> Optional<T> getService(Class<T> serviceType) {
+ Optional<T> cached = (Optional<T>)singletons.get(serviceType);
+ if(cached==null) {
+ List<? extends T> services = getServices(serviceType, Collections.emptyList());
+ if (services.isEmpty()) {
+ cached = Optional.empty();
+ }
+ else{
+ cached = Optional.of(services.get(0));
+ }
+ singletons.put(serviceType, cached);
+ }
+ return cached;
+ }
+
+ /**
+ * Loads and registers services.
+ *
+ * @param serviceType
+ * The service type.
+ * @param <T>
+ * the concrete type.
+ * @param defaultList
+ * the list current items returned, if no services were found.
+ * @return the items found, never {@code null}.
+ */
+ @Override
+ public <T> List<? extends T> getServices(final Class<T> serviceType, final List<? extends T> defaultList) {
+ List<T> found = (List<T>) servicesLoaded.get(serviceType);
+ if (found != null) {
+ return found;
+ }
+ return loadServices(serviceType, defaultList);
+ }
+
+ /**
+ * Loads and registers services.
+ *
+ * @param serviceType The service type.
+ * @param <T> the concrete type.
+ * @param defaultList the list current items returned, if no services were found.
+ *
+ * @return the items found, never {@code null}.
+ */
+ private <T> List<? extends T> loadServices(final Class<T> serviceType, final List<? extends T> defaultList) {
+ try {
+ List<T> services = new ArrayList<>();
+ for (T t : ServiceLoader.load(serviceType)) {
+ services.add(t);
+ }
+ if(services.isEmpty()){
+ services.addAll(defaultList);
+ }
+ services = Collections.unmodifiableList(services);
+ final List<T> previousServices = (List<T>) servicesLoaded.putIfAbsent(serviceType, (List<Object>)services);
+ return previousServices != null ? previousServices : services;
+ } catch (Exception e) {
+ Logger.getLogger(DefaultServiceContextProvider.class.getName()).log(Level.WARNING,
+ "Error loading services current type " + serviceType, e);
+ return defaultList;
+ }
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/spi/PropertyAdapterSpi.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/spi/PropertyAdapterSpi.java b/dormant/api/src/main/java/org/apache/tamaya/spi/PropertyAdapterSpi.java
new file mode 100644
index 0000000..a1222a4
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/spi/PropertyAdapterSpi.java
@@ -0,0 +1,72 @@
+/*
+ * 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.spi;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.PropertyAdapter;
+import org.apache.tamaya.annotation.WithPropertyAdapter;
+
+
+/**
+ * Manager for {@link org.apache.tamaya.Configuration} instances. Implementations must register an instance
+ * using the {@link org.apache.tamaya.spi.ServiceContextManager} mechanism in place (by default this is based on the {@link java.util.ServiceLoader}.
+ * The {@link org.apache.tamaya.Configuration} Singleton in the API delegates its corresponding calls to the
+ * instance returned by the current bootstrap service in place.
+ *
+ * @see org.apache.tamaya.Configuration
+ * @see org.apache.tamaya.spi.ServiceContextManager
+ */
+public interface PropertyAdapterSpi {
+
+
+ /**
+ * Registers a new PropertyAdapter for the given target type, hereby replacing any existing adapter for
+ * this type.
+ * @param targetType The target class, not null.
+ * @param adapter The adapter, not null.
+ * @param <T> The target type
+ * @return any adapter replaced with the new adapter, or null.
+ */
+ <T> PropertyAdapter<T> register(Class<T> targetType, PropertyAdapter<T> adapter);
+
+ /**
+ * Get an adapter converting to the given target type.
+ * @param targetType the target type class
+ * @return true, if the given target type is supported.
+ */
+ default <T> PropertyAdapter<T> getAdapter(Class<T> targetType){
+ return getPropertyAdapter(targetType, null);
+ }
+
+ /**
+ * Get an adapter converting to the given target type.
+ * @param targetType the target type class
+ * @param <T> the target type
+ * @return the corresponding adapter, never null.
+ * @throws org.apache.tamaya.ConfigException if the target type is not supported.
+ */
+ <T> PropertyAdapter<T> getPropertyAdapter(Class<T> targetType, WithPropertyAdapter annotation);
+
+ /**
+ * Checks if the given target type is supported, i.e. a adapter is registered and accessible.
+ * @param targetType the target type class
+ * @return true, if the given target type is supported.
+ */
+ boolean isTargetTypeSupported(Class<?> targetType);
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java b/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
new file mode 100644
index 0000000..a2e127e
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
@@ -0,0 +1,109 @@
+/*
+ * 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.spi;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+/**
+ * This class models the component that is managing the lifecycle current the
+ * services used by the Configuration API.
+ */
+public interface ServiceContext {
+
+ /**
+ * Delegate method for {@link ServiceContext#getService(Class)}.
+ *
+ * @param serviceType the service type.
+ * @return the service found, never {@code null}.
+ * @see ServiceContext#getService(Class)
+ */
+ default <T> T getSingleton(Class<T> serviceType) {
+ return getService(serviceType)
+ .orElseThrow(() -> new IllegalStateException("Singleton missing: " + serviceType.getName()));
+ }
+
+ /**
+ * Delegate method for {@link ServiceContext#getService(Class)}.
+ *
+ * @param serviceType the service type.
+ * @return the service found, never {@code null}.
+ * @see ServiceContext#getService(Class)
+ */
+ default <T> T getSingleton(Class<T> serviceType, Supplier<T> defaultSupplier) {
+ return getService(serviceType)
+ .orElse((defaultSupplier.get()));
+ }
+
+ /**
+ * Access a singleton, given its type.
+ *
+ * @param serviceType
+ * the service type.
+ * @return The instance to be used, never {@code null}
+ */
+ <T> Optional<T> getService(Class<T> serviceType);
+
+ /**
+ * Access a list current services, given its type. The bootstrap mechanism should
+ * order the instance for precedence, hereby the most significant should be
+ * first in order.
+ *
+ * @param serviceType
+ * the service type.
+ * @param defaultList
+ * the lis returned, if no services could be found.
+ * @return The instance to be used, never {@code null}
+ */
+ <T> List<? extends T> getServices(Class<T> serviceType, List<? extends T> defaultList);
+
+ /**
+ * Access a list current services, given its type. The bootstrap mechanism should
+ * order the instance for precedence, hereby the most significant should be
+ * first in order.
+ *
+ * @param serviceType
+ * the service type.
+ * @return The instance to be used, never {@code null}
+ */
+ default <T> List<? extends T> getServices(Class<T> serviceType){
+ return getServices(serviceType, Collections.emptyList());
+ }
+
+ /**
+ * Get the current {@link ServiceContext}. If necessary the {@link ServiceContext} will be laziliy loaded.
+ *
+ * @return the {@link ServiceContext} to be used.
+ */
+ public static ServiceContext getInstance(){
+ return ServiceContextManager.getServiceContext();
+ }
+
+ /**
+ * Replace the current {@link ServiceContext} in use.
+ *
+ * @param serviceContext the new {@link ServiceContext}, not null.
+ */
+ public static ServiceContext set(ServiceContext serviceContext){
+ return ServiceContextManager.set(Objects.requireNonNull(serviceContext));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContextManager.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContextManager.java b/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContextManager.java
new file mode 100644
index 0000000..63e4d70
--- /dev/null
+++ b/dormant/api/src/main/java/org/apache/tamaya/spi/ServiceContextManager.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This singleton provides access to the services available in the current {@link ServiceContext}. The
+ * behaviour can be adapted, by calling {@link ServiceContextManager#set(ServiceContext)} before accessing any
+ * services.
+ */
+final class ServiceContextManager {
+ /**
+ * The ServiceProvider used.
+ */
+ private static volatile ServiceContext serviceContextProviderDelegate;
+ /**
+ * The shared lock instance user.
+ */
+ private static final Object LOCK = new Object();
+
+ /**
+ * Private singletons constructor.
+ */
+ private ServiceContextManager() {
+ }
+
+ /**
+ * Load the {@link ServiceContext} to be used.
+ *
+ * @return {@link ServiceContext} to be used for loading the services.
+ */
+ private static ServiceContext loadDefaultServiceProvider() {
+ try {
+ for (ServiceContext sp : ServiceLoader.load(ServiceContext.class)) {
+ return sp;
+ }
+ } catch (Exception e) {
+ Logger.getLogger(ServiceContextManager.class.getName()).log(Level.INFO, "Using default ServiceProvider.");
+ }
+ return new DefaultServiceContextProvider();
+ }
+
+ /**
+ * Replace the current {@link ServiceContext} in use.
+ *
+ * @param serviceContextProvider the new {@link ServiceContext}, not null.
+ */
+ public static ServiceContext set(ServiceContext serviceContextProvider) {
+ ServiceContext currentContext = ServiceContextManager.serviceContextProviderDelegate;
+ Objects.requireNonNull(serviceContextProvider);
+ synchronized (LOCK) {
+ if (ServiceContextManager.serviceContextProviderDelegate == null) {
+ ServiceContextManager.serviceContextProviderDelegate = serviceContextProvider;
+ Logger.getLogger(ServiceContextManager.class.getName())
+ .log(Level.INFO, "Using ServiceProvider: " + serviceContextProvider.getClass().getName());
+ } else {
+ Logger.getLogger(ServiceContextManager.class.getName())
+ .log(Level.WARNING, "Replacing ServiceProvider " + ServiceContextManager.serviceContextProviderDelegate.getClass().getName() + " with: " + serviceContextProvider.getClass().getName());
+ ServiceContextManager.serviceContextProviderDelegate = serviceContextProvider;
+ }
+ }
+ return currentContext;
+ }
+
+ /**
+ * Ge {@link ServiceContext}. If necessary the {@link ServiceContext} will be laziliy loaded.
+ *
+ * @return the {@link ServiceContext} used.
+ */
+ public static ServiceContext getServiceContext() {
+ if (serviceContextProviderDelegate == null) {
+ synchronized (LOCK) {
+ if (serviceContextProviderDelegate == null) {
+ serviceContextProviderDelegate = loadDefaultServiceProvider();
+ }
+ }
+ }
+ return serviceContextProviderDelegate;
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/java/annottext/AnnotatedConfig.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/java/annottext/AnnotatedConfig.java b/dormant/api/src/test/java/annottext/AnnotatedConfig.java
new file mode 100644
index 0000000..20b135f
--- /dev/null
+++ b/dormant/api/src/test/java/annottext/AnnotatedConfig.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package annottext;
+
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.WithLoadPolicy;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.LoadPolicy;
+
+/**
+ * An example showing some basic annotations, using an interface to be proxied by the
+ * configuration system.
+ * Created by Anatole on 15.02.14.
+ */
+@WithLoadPolicy(LoadPolicy.INITIAL)
+public interface AnnotatedConfig {
+
+ @ConfiguredProperty(keys = "foo.bar.myprop")
+ @ConfiguredProperty(keys = "mp")
+ @ConfiguredProperty(keys = "common.test.myProperty")
+ @DefaultValue("myValue_$[env.stage]")
+ // @ConfigLoadPolicy(listener = MyListener.class)
+ String myParameter();
+
+ @ConfiguredProperty(keys = "simple_value")
+ @WithLoadPolicy(LoadPolicy.LAZY)
+ String simpleValue();
+
+ @ConfiguredProperty
+ String simplestValue();
+
+ @ConfiguredProperty(keys = "env.host.name")
+ String hostName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/java/annottext/AnnotatedFullConfig.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/java/annottext/AnnotatedFullConfig.java b/dormant/api/src/test/java/annottext/AnnotatedFullConfig.java
new file mode 100644
index 0000000..df39d12
--- /dev/null
+++ b/dormant/api/src/test/java/annottext/AnnotatedFullConfig.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy 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 annottext;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.WithLoadPolicy;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.LoadPolicy;
+
+/**
+ * An example showing some basic annotations, using an interface to be proxied by the
+ * configuration system, nevertheless extending the overall Configuration interface.
+ * Created by Anatole on 15.02.14.
+ */
+@WithLoadPolicy(LoadPolicy.INITIAL)
+public interface AnnotatedFullConfig extends Configuration{
+
+ @ConfiguredProperty(keys = "foo.bar.myprop")
+ @ConfiguredProperty(keys = "mp")
+ @ConfiguredProperty(keys = "common.test.myProperty")
+ @DefaultValue("myValue_$[env.stage]")
+ // @ConfigLoadPolicy(listener = MyListener.class)
+ String myParameter();
+
+ @ConfiguredProperty(keys = "simple_value")
+ @WithLoadPolicy(LoadPolicy.LAZY)
+ String simpleValue();
+
+ @ConfiguredProperty
+ String simplestValue();
+
+ @ConfiguredProperty(keys = "env.host.name")
+ String hostName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/java/org/apache/tamaya/TestConfigServiceSingletonSpi.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/java/org/apache/tamaya/TestConfigServiceSingletonSpi.java b/dormant/api/src/test/java/org/apache/tamaya/TestConfigServiceSingletonSpi.java
new file mode 100644
index 0000000..858786d
--- /dev/null
+++ b/dormant/api/src/test/java/org/apache/tamaya/TestConfigServiceSingletonSpi.java
@@ -0,0 +1,90 @@
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Consumer;
+
+import org.apache.tamaya.spi.ConfigurationSpi;
+
+/**
+ * Created by Anatole on 09.09.2014.
+ */
+public class TestConfigServiceSingletonSpi implements ConfigurationSpi {
+
+
+ private Map<String, Configuration> configs = new ConcurrentHashMap<>();
+
+ public TestConfigServiceSingletonSpi(){
+ Map<String,String> config = new HashMap<>();
+ config.put("a.b.c.key1", "keys current a.b.c.key1");
+ config.put("a.b.c.key2", "keys current a.b.c.key2");
+ config.put("a.b.key3", "keys current a.b.key3");
+ config.put("a.b.key4", "keys current a.b.key4");
+ config.put("a.key5", "keys current a.key5");
+ config.put("a.key6", "keys current a.key6");
+ config.put("int1", "123456");
+ config.put("int2", "111222");
+ config.put("booleanT", "true");
+ config.put("double1", "1234.5678");
+ config.put("BD", "123456789123456789123456789123456789.123456789123456789123456789123456789");
+ config.put("testProperty", "keys current testProperty");
+ config.put("runtimeVersion", "${java.version}");
+ // configs.put("test", new MapConfiguration(MetaInfoBuilder.current().setName("test").build(), config));
+ }
+
+
+
+ @Override
+ public boolean isConfigurationAvailable(String name){
+ return configs.containsKey(name);
+ }
+
+ @Override
+ public Configuration getConfiguration(String name) {
+ // TODO
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public <T> T createTemplate(Class<T> type, Configuration... configurations) {
+ // TODO
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void configure(Object instance, Configuration... configurations) {
+ // TODO
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public String evaluateValue(String expression, Configuration... configurations) {
+ // TODO improve this ugly implementation...
+ for (Configuration config : configurations) {
+ for (Map.Entry<String, String> en : config.getProperties().entrySet()) {
+ expression = expression.replaceAll("\\$\\{" + en.getKey() + "\\}", en.getValue());
+ }
+ }
+ return expression;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/java/org/apache/tamaya/TestPropertyAdaptersSingletonSpi.java
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/java/org/apache/tamaya/TestPropertyAdaptersSingletonSpi.java b/dormant/api/src/test/java/org/apache/tamaya/TestPropertyAdaptersSingletonSpi.java
new file mode 100644
index 0000000..65e6c1d
--- /dev/null
+++ b/dormant/api/src/test/java/org/apache/tamaya/TestPropertyAdaptersSingletonSpi.java
@@ -0,0 +1,99 @@
+/*
+ * 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;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.Currency;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.tamaya.annotation.WithPropertyAdapter;
+import org.apache.tamaya.spi.PropertyAdapterSpi;
+
+/**
+ * Test implementation current {@link org.apache.tamaya.spi.PropertyAdapterSpi}, which provides propertyAdapters
+ * for some basic types.
+ */
+@SuppressWarnings({"unchecked", "rawtypes"})
+public final class TestPropertyAdaptersSingletonSpi implements PropertyAdapterSpi {
+
+ private Map<Class, PropertyAdapter<?>> propertyAdapters = new ConcurrentHashMap<>();
+
+ private TestPropertyAdaptersSingletonSpi(){
+ register(char.class, (s) -> s.charAt(0));
+ register(int.class, Integer::parseInt);
+ register(byte.class, Byte::parseByte);
+ register(short.class, Short::parseShort);
+ register(boolean.class, Boolean::parseBoolean);
+ register(float.class, Float::parseFloat);
+ register(double.class, Double::parseDouble);
+
+ register(Character.class, (s) -> s.charAt(0));
+ register(Integer.class, Integer::valueOf);
+ register(Byte.class, Byte::valueOf);
+ register(Short.class, Short::valueOf);
+ register(Boolean.class, Boolean::valueOf);
+ register(Float.class, Float::valueOf);
+ register(Double.class, Double::valueOf);
+ register(BigDecimal.class, BigDecimal::new);
+ register(BigInteger.class, BigInteger::new);
+
+ register(Currency.class, Currency::getInstance);
+
+ register(LocalDate.class, LocalDate::parse);
+ register(LocalTime.class, LocalTime::parse);
+ register(LocalDateTime.class, LocalDateTime::parse);
+ register(ZoneId.class, ZoneId::of);
+ }
+
+
+ @Override
+ public <T> PropertyAdapter<T> register(Class<T> targetType, PropertyAdapter<T> codec){
+ Objects.requireNonNull(targetType);
+ Objects.requireNonNull(codec);
+ return (PropertyAdapter<T>) propertyAdapters.put(targetType, codec);
+ }
+
+ @Override
+ public <T> PropertyAdapter<T> getPropertyAdapter(Class<T> targetType, WithPropertyAdapter annotation){
+ if(annotation!=null){
+ Class<?> adapterType = annotation.value();
+ if(!adapterType.equals(PropertyAdapter.class)){
+ try{
+ return (PropertyAdapter<T>)adapterType.newInstance();
+ }
+ catch(Exception e){
+ throw new ConfigException("Failed to load PropertyAdapter: " + adapterType, e);
+ }
+ }
+ }
+ return (PropertyAdapter<T>) propertyAdapters.get(targetType);
+ }
+
+ @Override
+ public boolean isTargetTypeSupported(Class<?> targetType){
+ return propertyAdapters.containsKey(targetType);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/resources/META-INF/beans.xml b/dormant/api/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..5207c9a
--- /dev/null
+++ b/dormant/api/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy current the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationSpi
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationSpi b/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationSpi
new file mode 100644
index 0000000..1b0cdd4
--- /dev/null
+++ b/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.ConfigurationSpi
@@ -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.TestConfigServiceSingletonSpi
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertyAdapterSpi
----------------------------------------------------------------------
diff --git a/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertyAdapterSpi b/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertyAdapterSpi
new file mode 100644
index 0000000..e9b04b4
--- /dev/null
+++ b/dormant/api/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertyAdapterSpi
@@ -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.TestPropertyAdaptersSingletonSpi
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/buildtools/pom.xml
----------------------------------------------------------------------
diff --git a/dormant/buildtools/pom.xml b/dormant/buildtools/pom.xml
new file mode 100644
index 0000000..434563e
--- /dev/null
+++ b/dormant/buildtools/pom.xml
@@ -0,0 +1,35 @@
+<?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 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>buildtools</artifactId>
+ <name>Apache Tamaya - Build Tools</name>
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/buildtools/src/main/resources/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/dormant/buildtools/src/main/resources/findbugs-exclude.xml b/dormant/buildtools/src/main/resources/findbugs-exclude.xml
new file mode 100644
index 0000000..8a29761
--- /dev/null
+++ b/dormant/buildtools/src/main/resources/findbugs-exclude.xml
@@ -0,0 +1,22 @@
+<!--
+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.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<FindBugsFilter>
+
+</FindBugsFilter>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d9964c64/dormant/core/pom.xml
----------------------------------------------------------------------
diff --git a/dormant/core/pom.xml b/dormant/core/pom.xml
new file mode 100644
index 0000000..85ef679
--- /dev/null
+++ b/dormant/core/pom.xml
@@ -0,0 +1,114 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy current the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>tamaya-core</artifactId>
+ <name>Apache Tamaya - Core Implementation Library</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <slf4j.version>1.7.2</slf4j.version>
+ <log4j.version>1.2.17</log4j.version>
+ <log4j2.version>2.1</log4j2.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <!-- ======================================================= -->
+ <!-- Packaging (OSGi bundle) -->
+ <!-- =======================================================
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-package>org.apache.tamaya.*</Import-package>
+ <Import-package>org.apache.tamaya.spi.*</Import-package>
+ <Import-package>org.apache.tamaya.injectt.*</Import-package>
+ <Export-Package>org.apache.tamaya.core.cdi.*</Export-Package>
+ <Export-Package>org.apache.tamaya.core.config.*</Export-Package>
+ <Export-Package>org.apache.tamaya.core.env.*</Export-Package>
+ <Export-Package>org.apache.tamaya.core.properties.*</Export-Package>
+ <Export-Package>org.apache.tamaya.core.spi.*</Export-Package>
+ <Private-Package>!*</Private-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ -->
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>