tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [3/3] incubator-tamaya git commit: Renamed ConfigRoot to ConfigurableType. Made module compatible with Java 7.
Date Fri, 24 Jul 2015 22:55:42 GMT
Renamed ConfigRoot to ConfigurableType.
Made module compatible with Java 7.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/461a51eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/461a51eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/461a51eb

Branch: refs/heads/master
Commit: 461a51eb7e5e39bcdd278ff33ae0c38ad7eec178
Parents: 6d2f649
Author: anatole <atsticks@gmail.com>
Authored: Sat Jul 25 00:54:33 2015 +0200
Committer: anatole <atsticks@gmail.com>
Committed: Sat Jul 25 00:54:33 2015 +0200

----------------------------------------------------------------------
 .../org/apache/tamaya/inject/ConfigRoot.java    | 43 -----------------
 .../tamaya/inject/ConfigurationInjector.java    |  2 +-
 .../tamaya/inject/ConfiguredItemSupplier.java   | 41 ++++++++++++++++
 .../tamaya/inject/ConfiguredProperty.java       |  5 +-
 .../apache/tamaya/inject/ConfiguredType.java    | 51 ++++++++++++++++++++
 .../org/apache/tamaya/inject/DynamicValue.java  |  6 +--
 .../java/org/apache/tamaya/inject/Supplier.java | 41 ----------------
 .../tamaya/inject/WithConfigOperator.java       |  2 +-
 .../tamaya/inject/internal/ConfiguredType.java  |  3 +-
 .../internal/DefaultConfigurationInjector.java  |  8 +--
 .../inject/internal/DefaultDynamicValue.java    |  8 +--
 .../tamaya/inject/internal/InjectionUtils.java  | 20 ++++----
 .../internal/DefaultDynamicValueTest.java       | 12 ++---
 13 files changed, 123 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigRoot.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigRoot.java b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigRoot.java
deleted file mode 100644
index 86de2fb..0000000
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigRoot.java
+++ /dev/null
@@ -1,43 +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.inject;
-
-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 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 ConfigRoot {
-
-    /**
-     * 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/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java
index 0ac4509..16a2a90 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfigurationInjector.java
@@ -47,6 +47,6 @@ public interface ConfigurationInjector {
      * @param <T> the target type.
      * @return a supplier creating configured instances of {@code T}.
      */
-    <T> Supplier<T> getConfiguredSupplier(Supplier<T> supplier);
+    <T> ConfiguredItemSupplier<T> getConfiguredSupplier(ConfiguredItemSupplier<T>
supplier);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredItemSupplier.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredItemSupplier.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredItemSupplier.java
new file mode 100644
index 0000000..2cb9af1
--- /dev/null
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredItemSupplier.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.inject;
+
+/**
+ * Represents a supplier of results.
+ * <p>
+ * <p>There is no requirement that a new or distinct result be returned each
+ * time the supplier is invoked.
+ * <p>
+ * <p>This is a functional interface,
+ * whose functional method is {@link #get()}.
+ *
+ * @param <T> the type of results supplied by this supplier
+ */
+//@FunctionalInterface
+public interface ConfiguredItemSupplier<T> {
+
+    /**
+     * Gets a result.
+     *
+     * @return a result
+     */
+    T get();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredProperty.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredProperty.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredProperty.java
index 25c812f..b84df0d 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredProperty.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredProperty.java
@@ -54,9 +54,8 @@ import java.lang.annotation.Target;
  * 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}"}}
+ *   @ConfiguredProperty(keys={"a.b.value", "a.b.deprecated.keys"})
+ *   @ConfiguredProperty(keys="a")
  *   private String aValue;
  * }
  *

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredType.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredType.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredType.java
new file mode 100644
index 0000000..78d1ea2
--- /dev/null
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/ConfiguredType.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.inject;
+
+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 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 ConfiguredType {
+
+    /**
+     * Allows to declare an section names that are prepended to resolve relative configuration
keys.
+     * @return the section names to used for key resolution.
+     */
+    String[] defaultSections() default {};
+
+    /**
+     * Property that can be used to let Tamaya automatically configure all matching fields
and setter methods.
+     * By default the configuration keys are built using the field's or method's name.
+     *
+     * @return true, for letting Tamaya utomatically configure a type.
+     */
+    boolean autoConfigure() default false;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/DynamicValue.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/DynamicValue.java b/modules/injection/src/main/java/org/apache/tamaya/inject/DynamicValue.java
index b4e671c..b420c71 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/DynamicValue.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/DynamicValue.java
@@ -154,13 +154,13 @@ public interface DynamicValue<T> {
      * Return the value if present, otherwise invoke {@code other} and return
      * the result of that invocation.
      *
-     * @param other a {@code Supplier} whose result is returned if no value
+     * @param other a {@code ConfiguredItemSupplier} whose result is returned if no value
      * is present
      * @return the value if present otherwise the result of {@code other.get()}
      * @throws NullPointerException if value is not present and {@code other} is
      * null
      */
-    T orElseGet(Supplier<? extends T> other);
+    T orElseGet(ConfiguredItemSupplier<? extends T> other);
 
     /**
      * Return the contained value, if present, otherwise throw an exception
@@ -178,6 +178,6 @@ public interface DynamicValue<T> {
      * @throws NullPointerException if no value is present and
      * {@code exceptionSupplier} is null
      */
-    <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier)
throws X;
+    <X extends Throwable> T orElseThrow(ConfiguredItemSupplier<? extends X> exceptionSupplier)
throws X;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/Supplier.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/Supplier.java b/modules/injection/src/main/java/org/apache/tamaya/inject/Supplier.java
deleted file mode 100644
index b494d97..0000000
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/Supplier.java
+++ /dev/null
@@ -1,41 +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.inject;
-
-/**
- * Represents a supplier of results.
- * <p>
- * <p>There is no requirement that a new or distinct result be returned each
- * time the supplier is invoked.
- * <p>
- * <p>This is a functional interface,
- * whose functional method is {@link #get()}.
- *
- * @param <T> the type of results supplied by this supplier
- */
-//@FunctionalInterface
-public interface Supplier<T> {
-
-    /**
-     * Gets a result.
-     *
-     * @return a result
-     */
-    T get();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/WithConfigOperator.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/WithConfigOperator.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/WithConfigOperator.java
index c2446c0..e43ebc3 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/WithConfigOperator.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/WithConfigOperator.java
@@ -32,7 +32,7 @@ import java.util.function.UnaryOperator;
  * constraints.
  */
 @Retention(RetentionPolicy.RUNTIME)
-@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
+@Target(value = {ElementType.TYPE})
 public @interface WithConfigOperator {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/internal/ConfiguredType.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/ConfiguredType.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/ConfiguredType.java
index 8ec34e5..020064d 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/ConfiguredType.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/ConfiguredType.java
@@ -25,7 +25,6 @@ import java.util.*;
 import java.util.logging.Logger;
 
 import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.inject.ConfigRoot;
 import org.apache.tamaya.inject.ConfiguredProperty;
 import org.apache.tamaya.inject.NoConfig;
 import org.apache.tamaya.event.ObservesConfigChange;
@@ -200,7 +199,7 @@ public class ConfiguredType {
 
 
     public static boolean isConfigured(Class type) {
-        if (type.getAnnotation(ConfigRoot.class) != null) {
+        if (type.getAnnotation(org.apache.tamaya.inject.ConfiguredType.class) != null) {
             return true;
         }
         // if no class level annotation is there we might have field level annotations only

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java
index 853d223..cb6448e 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultConfigurationInjector.java
@@ -27,7 +27,7 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.tamaya.inject.Supplier;
+import org.apache.tamaya.inject.ConfiguredItemSupplier;
 
 /**
  * Simple injector singleton that also registers instances configured using weak references.
@@ -82,14 +82,14 @@ public final class DefaultConfigurationInjector implements ConfigurationInjector
         if(cl==null){
             cl = this.getClass().getClassLoader();
         }
-        return (T)Proxy.newProxyInstance(cl,new Class[]{Supplier.class, Objects.requireNonNull(templateType)},
+        return (T) Proxy.newProxyInstance(cl, new Class[]{ConfiguredItemSupplier.class, Objects.requireNonNull(templateType)},
                 new ConfigTemplateInvocationHandler(templateType, ConfigurationProvider.getConfiguration()));
     }
 
 
     @Override
-    public <T> Supplier<T> getConfiguredSupplier(final Supplier<T> supplier)
{
-        return new Supplier<T>() {
+    public <T> ConfiguredItemSupplier<T> getConfiguredSupplier(final ConfiguredItemSupplier<T>
supplier) {
+        return new ConfiguredItemSupplier<T>() {
             public T get() {
                 return supplier.get();
             }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java
index 8ca7703..433ea00 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/DefaultDynamicValue.java
@@ -20,7 +20,7 @@ package org.apache.tamaya.inject.internal;
 
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.Configuration;
-import org.apache.tamaya.inject.Supplier;
+import org.apache.tamaya.inject.ConfiguredItemSupplier;
 import org.apache.tamaya.spi.PropertyConverter;
 import org.apache.tamaya.TypeLiteral;
 import org.apache.tamaya.inject.DynamicValue;
@@ -372,13 +372,13 @@ public final class DefaultDynamicValue<T> implements DynamicValue<T>,
Serializab
      * Return the value if present, otherwise invoke {@code other} and return
      * the result of that invocation.
      *
-     * @param other a {@code Supplier} whose result is returned if no value
+     * @param other a {@code ConfiguredItemSupplier} whose result is returned if no value
      *              is present
      * @return the value if present otherwise the result of {@code other.get()}
      * @throws NullPointerException if value is not present and {@code other} is
      *                              null
      */
-    public T orElseGet(Supplier<? extends T> other) {
+    public T orElseGet(ConfiguredItemSupplier<? extends T> other) {
         if (value == null) {
             return other.get();
         }
@@ -401,7 +401,7 @@ public final class DefaultDynamicValue<T> implements DynamicValue<T>,
Serializab
      * @throws NullPointerException if no value is present and
      *                              {@code exceptionSupplier} is null
      */
-    public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier)
throws X {
+    public <X extends Throwable> T orElseThrow(ConfiguredItemSupplier<? extends
X> exceptionSupplier) throws X {
         if (value == null) {
             throw exceptionSupplier.get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/main/java/org/apache/tamaya/inject/internal/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/InjectionUtils.java
b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/InjectionUtils.java
index 4895af2..32a7d9c 100644
--- a/modules/injection/src/main/java/org/apache/tamaya/inject/internal/InjectionUtils.java
+++ b/modules/injection/src/main/java/org/apache/tamaya/inject/internal/InjectionUtils.java
@@ -32,7 +32,7 @@ import java.util.logging.Logger;
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.ConfigurationProvider;
 import org.apache.tamaya.TypeLiteral;
-import org.apache.tamaya.inject.ConfigRoot;
+import org.apache.tamaya.inject.ConfiguredType;
 import org.apache.tamaya.inject.ConfiguredProperty;
 import org.apache.tamaya.inject.DefaultValue;
 import org.apache.tamaya.inject.WithLoadPolicy;
@@ -72,7 +72,7 @@ final class InjectionUtils {
      *                           several keys to be looked up (in absolute or relative form).
      * @return the list current keys in order how they should be processed/looked up.
      */
-    public static List<String> evaluateKeys(Member member, ConfigRoot areasAnnot, ConfiguredProperty
propertyAnnotation) {
+    public static List<String> evaluateKeys(Member member, ConfiguredType areasAnnot,
ConfiguredProperty propertyAnnotation) {
         if(propertyAnnotation==null){
             return evaluateKeys(member, areasAnnot);
         }
@@ -106,7 +106,7 @@ final class InjectionUtils {
      * @param areasAnnot the (optional) annotation definining areas to be looked up.
      * @return the list current keys in order how they should be processed/looked up.
      */
-    public static List<String> evaluateKeys(Member member, ConfigRoot areasAnnot) {
+    public static List<String> evaluateKeys(Member member, ConfiguredType areasAnnot)
{
         List<String> keys = new ArrayList<>();
         String name = member.getName();
         String mainKey;
@@ -135,7 +135,7 @@ final class InjectionUtils {
      * @return the keys to be returned, or null.
      */
     public static String getConfigValue(Method method) {
-        ConfigRoot areasAnnot = method.getDeclaringClass().getAnnotation(ConfigRoot.class);
+        ConfiguredType areasAnnot = method.getDeclaringClass().getAnnotation(ConfiguredType.class);
         WithLoadPolicy loadPolicy = Utils.getAnnotation(WithLoadPolicy.class, method, method.getDeclaringClass());
         return getConfigValueInternal(method, areasAnnot, loadPolicy);
     }
@@ -147,7 +147,7 @@ final class InjectionUtils {
      * @return the keys to be returned, or null.
      */
     public static String getConfigValue(Field field) {
-        ConfigRoot areasAnnot = field.getDeclaringClass().getAnnotation(ConfigRoot.class);
+        ConfiguredType areasAnnot = field.getDeclaringClass().getAnnotation(ConfiguredType.class);
         WithLoadPolicy loadPolicy = Utils.getAnnotation(WithLoadPolicy.class, field, field.getDeclaringClass());
         return getConfigValueInternal(field, areasAnnot, loadPolicy);
     }
@@ -157,7 +157,7 @@ final class InjectionUtils {
      *
      * @return the keys to be returned, or null.
      */
-    private static String getConfigValueInternal(AnnotatedElement element, ConfigRoot areasAnnot,
WithLoadPolicy loadPolicy) {
+    private static String getConfigValueInternal(AnnotatedElement element, ConfiguredType
areasAnnot, WithLoadPolicy loadPolicy) {
         ConfiguredProperty prop = element.getAnnotation(ConfiguredProperty.class);
         DefaultValue defaultAnnot = element.getAnnotation(DefaultValue.class);
         String configValue = null;
@@ -176,23 +176,23 @@ final class InjectionUtils {
 
     /**
      * Collects all keys to be be accessed as defined by any annotations of type
-     * {@link org.apache.tamaya.inject.ConfigRoot}, {@link org.apache.tamaya.inject.ConfiguredProperty}.
+     * {@link ConfiguredType}, {@link org.apache.tamaya.inject.ConfiguredProperty}.
      * @param field the (optionally) annotated field instance
      * @return the regarding key list to be accessed fomr the {@link org.apache.tamaya.Configuration}.
      */
     public static List<String> getKeys(Field field) {
-        ConfigRoot areasAnnot = field.getDeclaringClass().getAnnotation(ConfigRoot.class);
+        ConfiguredType areasAnnot = field.getDeclaringClass().getAnnotation(ConfiguredType.class);
         return InjectionUtils.evaluateKeys((Member) field, areasAnnot, field.getAnnotation(ConfiguredProperty.class));
     }
 
     /**
      * Collects all keys to be be accessed as defined by any annotations of type
-     * {@link org.apache.tamaya.inject.ConfigRoot}, {@link org.apache.tamaya.inject.ConfiguredProperty}.
+     * {@link ConfiguredType}, {@link org.apache.tamaya.inject.ConfiguredProperty}.
      * @param method the (optionally) annotated method instance
      * @return the regarding key list to be accessed fomr the {@link org.apache.tamaya.Configuration}.
      */
     public static List<String> getKeys(Method method) {
-        ConfigRoot areasAnnot = method.getDeclaringClass().getAnnotation(ConfigRoot.class);
+        ConfiguredType areasAnnot = method.getDeclaringClass().getAnnotation(ConfiguredType.class);
         return InjectionUtils.evaluateKeys((Member) method, areasAnnot, method.getAnnotation(ConfiguredProperty.class));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/461a51eb/modules/injection/src/test/java/org/apache/tamaya/inject/internal/DefaultDynamicValueTest.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/test/java/org/apache/tamaya/inject/internal/DefaultDynamicValueTest.java
b/modules/injection/src/test/java/org/apache/tamaya/inject/internal/DefaultDynamicValueTest.java
index 9ec2f31..d95123d 100644
--- a/modules/injection/src/test/java/org/apache/tamaya/inject/internal/DefaultDynamicValueTest.java
+++ b/modules/injection/src/test/java/org/apache/tamaya/inject/internal/DefaultDynamicValueTest.java
@@ -21,11 +21,9 @@ package org.apache.tamaya.inject.internal;
 import org.apache.tamaya.ConfigException;
 import org.apache.tamaya.ConfigurationProvider;
 import org.apache.tamaya.builder.ConfigurationBuilder;
-import org.apache.tamaya.core.internal.converters.DoubleConverter;
+import org.apache.tamaya.inject.ConfiguredItemSupplier;
 import org.apache.tamaya.inject.ConfiguredProperty;
 import org.apache.tamaya.inject.DynamicValue;
-import org.apache.tamaya.inject.Supplier;
-import org.apache.tamaya.inject.WithPropertyConverter;
 import org.apache.tamaya.spi.PropertyConverter;
 import org.apache.tamaya.spi.PropertySource;
 import org.junit.Test;
@@ -283,7 +281,7 @@ public class DefaultDynamicValueTest {
         DynamicValue val = DefaultDynamicValue.of(getClass().getDeclaredField("myValue"),
                 config);
         val.setUpdatePolicy(DynamicValue.UpdatePolicy.IMMEDIATE);
-        assertEquals("bla", val.orElseGet(new Supplier() {
+        assertEquals("bla", val.orElseGet(new ConfiguredItemSupplier() {
             @Override
             public Object get() {
                 return "bla";
@@ -291,7 +289,7 @@ public class DefaultDynamicValueTest {
         }));
         properties.put("a", "aValue");
         val.updateValue();
-        assertEquals("aValue", val.orElseGet(new Supplier() {
+        assertEquals("aValue", val.orElseGet(new ConfiguredItemSupplier() {
             @Override
             public Object get() {
                 return "bla";
@@ -305,7 +303,7 @@ public class DefaultDynamicValueTest {
                 config);
         val.setUpdatePolicy(DynamicValue.UpdatePolicy.EXPLCIT);
         properties.put("a", "aValue");
-        assertEquals("aValue", val.orElseThrow(new Supplier() {
+        assertEquals("aValue", val.orElseThrow(new ConfiguredItemSupplier() {
             @Override
             public ConfigException get() {
                 return new ConfigException("bla");
@@ -313,7 +311,7 @@ public class DefaultDynamicValueTest {
         }));
         properties.remove("a");
         val.updateValue();
-        assertEquals("aValue", val.orElseThrow(new Supplier() {
+        assertEquals("aValue", val.orElseThrow(new ConfiguredItemSupplier() {
             @Override
             public ConfigException get() {
                 return new ConfigException("bla");


Mime
View raw message