deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsme...@apache.org
Subject [2/2] deltaspike git commit: DELTASPIKE-892 type-safe static config * Type-safe fluent API for ConfigResolver * properties are easily typed * added Class and Double to types * new optional strict mode for resolution -- only falls back to default, not to
Date Mon, 04 May 2015 23:47:15 GMT
DELTASPIKE-892 type-safe static config
* Type-safe fluent API for ConfigResolver
* properties are easily typed
* added Class and Double to types
* new optional strict mode for resolution -- only falls back to default, not to less specific properties
* new simple interface for property type Converters
* ConfigProperty now also has 'projectStageAware' and 'parameter' attributes
* DefaultConfigPropertyProducer greatly simplified
* TypedConfig removed

* with Tests


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/25b2b8cc
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/25b2b8cc
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/25b2b8cc

Branch: refs/heads/master
Commit: 25b2b8cc0c955a28743f9a84925c8e410f0d298d
Parents: 320ae6e
Author: Ron Smeral <rsmeral@apache.org>
Authored: Thu Apr 30 14:05:53 2015 +0200
Committer: Ron Smeral <rsmeral@apache.org>
Committed: Tue May 5 01:39:45 2015 +0200

----------------------------------------------------------------------
 .../core/api/config/ConfigProperty.java         |   6 +
 .../core/api/config/ConfigResolver.java         | 325 ++++++++++++++++++-
 .../core/api/config/base/CoreBaseConfig.java    |  37 ++-
 .../core/api/config/base/TypedConfig.java       | 170 ----------
 .../core/api/provider/BeanManagerProvider.java  |   2 +-
 .../spi/config/BaseConfigPropertyProducer.java  |  31 +-
 .../test/api/config/ConfigResolverTest.java     |   4 +-
 .../test/api/config/TestConfigSource.java       |   7 +-
 .../test/api/config/TypedResolverTest.java      | 214 ++++++++++++
 .../test/api/config/typed/TestConfig.java       |  70 ----
 .../test/api/config/typed/TypedConfigTest.java  | 130 --------
 .../config/DefaultConfigPropertyProducer.java   |  88 ++---
 .../exclude/extension/ExcludeExtension.java     |   2 +-
 .../interceptor/GlobalInterceptorExtension.java |   2 +-
 .../core/impl/jmx/MBeanExtension.java           |   2 +-
 .../DefaultWindowContextQuotaHandler.java       |   2 +-
 .../BaseTestConfigProperty.java                 |  13 +-
 .../ConfigPropertyEARTest.java                  |   5 +-
 .../ConfigPropertyWARTest.java                  |   5 +-
 .../api/config/propertyconfigsource/MyBean.java |  91 +++++-
 .../impl/src/test/resources/myconfig.properties |  11 +
 .../jsf/api/config/base/JsfBaseConfig.java      |  46 ++-
 .../deltaspike/jsf/api/config/view/Folder.java  |   2 +-
 .../deltaspike/jsf/api/config/view/View.java    |   6 +-
 .../jsf/api/literal/FolderLiteral.java          |   2 +-
 .../deltaspike/jsf/api/literal/ViewLiteral.java |   6 +-
 .../scope/window/DefaultClientWindowConfig.java |   2 +-
 .../jsf/impl/util/ClientWindowHelper.java       |   4 +-
 .../deltaspike/jsf/impl/util/JsfUtils.java      |   2 +-
 .../scheduler/impl/CdiAwareJobFactory.java      |   2 +-
 .../scheduler/impl/QuartzScheduler.java         |   8 +-
 .../scheduler/impl/SchedulerBaseConfig.java     |  46 ++-
 .../scheduler/impl/SchedulerExtension.java      |   2 +-
 .../scheduler/custom/CustomConfigSource.java    |   2 +-
 .../custom/CustomDeactivatedConfigSource.java   |   4 +-
 .../testcontrol/api/junit/CdiTestRunner.java    |   2 +-
 .../api/junit/CdiTestSuiteRunner.java           |   2 +-
 .../testcontrol/api/junit/TestBaseConfig.java   |  33 +-
 .../impl/jsf/MyFacesContainerAdapter.java       |   2 +-
 .../impl/jsf/MyFacesTestBaseConfig.java         |   9 +-
 .../impl/mock/AbstractMockManager.java          |   8 +-
 .../impl/mock/DefaultMockFilter.java            |   4 +-
 42 files changed, 881 insertions(+), 530 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigProperty.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigProperty.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigProperty.java
index e32fbda..40172a9 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigProperty.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigProperty.java
@@ -130,4 +130,10 @@ public @interface ConfigProperty
      */
     @Nonbinding
     String defaultValue() default NULL;
+
+    @Nonbinding
+    boolean projectStageAware() default true;
+
+    @Nonbinding
+    String parameterizedBy() default NULL;
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
index f75f703..9cc662e 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
@@ -37,6 +37,7 @@ import org.apache.deltaspike.core.spi.config.ConfigFilter;
 import org.apache.deltaspike.core.spi.config.ConfigSource;
 import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
 import org.apache.deltaspike.core.util.ClassUtils;
+import org.apache.deltaspike.core.util.ExceptionUtils;
 import org.apache.deltaspike.core.util.ProjectStageProducer;
 import org.apache.deltaspike.core.util.ServiceUtils;
 
@@ -59,6 +60,7 @@ import org.apache.deltaspike.core.util.ServiceUtils;
 @Typed()
 public final class ConfigResolver
 {
+
     private static final Logger LOG = Logger.getLogger(ConfigResolver.class.getName());
 
     /**
@@ -478,9 +480,9 @@ public final class ConfigResolver
         return projectStage;
     }
 
-    private static String fallbackToDefaultIfEmpty(String key, String value, String defaultValue)
+    private static <T> T fallbackToDefaultIfEmpty(String key, T value, T defaultValue)
     {
-        if (value == null || value.isEmpty())
+        if (value == null || (value instanceof String && ((String)value).isEmpty()))
         {
             LOG.log(Level.FINE, "no configured value found for key {0}, using default value {1}.",
                     new Object[]{key, defaultValue});
@@ -527,4 +529,323 @@ public final class ConfigResolver
         return logValue;
     }
 
+    public interface Converter<T>
+    {
+
+        T convert(String value);
+
+    }
+
+    public interface TypedResolver<T>
+    {
+
+        TypedResolver<T> parameterizedBy(String propertyName);
+
+        TypedResolver<T> withCurrentProjectStage(boolean with);
+
+        TypedResolver<T> strictly(boolean strictly);
+
+        TypedResolver<T> withDefault(T value);
+
+        TypedResolver<T> withStringDefault(String value);
+
+        T getValue();
+
+        String getKey();
+
+        String getResolvedKey();
+
+        T getDefaultValue();
+
+    }
+
+    public interface UntypedResolver<T> extends TypedResolver<T>
+    {
+
+        <N> TypedResolver<N> as(Class<N> clazz);
+
+        <N> TypedResolver<N> as(Class<N> clazz, Converter<N> converter);
+
+    }
+
+    public static UntypedResolver<String> resolve(String name)
+    {
+        return new PropertyBuilder<String>(name);
+    }
+
+    private static class PropertyBuilder<T> implements UntypedResolver<T>
+    {
+
+        private String keyOriginal;
+
+        private String keyResolved;
+
+        private Class<?> configEntryType = String.class;
+
+        private T defaultValue;
+
+        private boolean projectStageAware = true;
+
+        private String propertyParameter;
+
+        private String parameterValue;
+
+        private boolean strictly = false;
+
+        private Converter<?> converter;
+
+
+        private PropertyBuilder()
+        {
+        }
+
+        protected PropertyBuilder(String propertyName)
+        {
+            this.keyOriginal = propertyName;
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public <N> TypedResolver<N> as(Class<N> clazz)
+        {
+            configEntryType = clazz;
+            return (TypedResolver<N>) this;
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public <N> TypedResolver<N> as(Class<N> clazz, Converter<N> converter)
+        {
+            configEntryType = clazz;
+            this.converter = converter;
+
+            return (TypedResolver<N>) this;
+        }
+
+        @Override
+        public TypedResolver<T> withDefault(T value)
+        {
+            defaultValue = value;
+            return this;
+        }
+
+        @Override
+        public TypedResolver<T> withStringDefault(String value)
+        {
+            if (value == null || value.isEmpty())
+            {
+                throw new RuntimeException("Empty String or null supplied as string-default value for property "
+                        + keyOriginal);
+            }
+
+            defaultValue = convert(value);
+            return this;
+        }
+
+        @Override
+        public TypedResolver<T> parameterizedBy(String propertyName)
+        {
+            this.propertyParameter = propertyName;
+
+            if (propertyParameter != null && !propertyParameter.isEmpty())
+            {
+                String parameterValue = ConfigResolver
+                        .resolve(propertyParameter)
+                        .withCurrentProjectStage(projectStageAware)
+                        .getValue();
+
+                if (parameterValue != null && !parameterValue.isEmpty())
+                {
+                    this.parameterValue = parameterValue;
+                }
+            }
+
+            return this;
+        }
+
+        @Override
+        public TypedResolver<T> withCurrentProjectStage(boolean with)
+        {
+            this.projectStageAware = with;
+            return this;
+        }
+
+        @Override
+        public TypedResolver<T> strictly(boolean strictly)
+        {
+            this.strictly = strictly;
+            return this;
+        }
+
+        @Override
+        public T getValue()
+        {
+            String valueStr = resolveStringValue();
+            T value = convert(valueStr);
+
+            return fallbackToDefaultIfEmpty(keyResolved, value, defaultValue);
+        }
+
+        @Override
+        public String getKey()
+        {
+            return keyOriginal;
+        }
+
+        @Override
+        public String getResolvedKey()
+        {
+            return keyResolved;
+        }
+
+        @Override
+        public T getDefaultValue()
+        {
+            return defaultValue;
+        }
+
+        /**
+         * Performs the resolution cascade
+         */
+        private String resolveStringValue()
+        {
+            ProjectStage ps = null;
+            String value = null;
+            keyResolved = keyOriginal;
+            int keySuffices = 0;
+
+            // make the longest key
+            // first, try appending resolved parameter
+            if (propertyParameter != null && !propertyParameter.isEmpty())
+            {
+                if (parameterValue != null && !parameterValue.isEmpty())
+                {
+                    keyResolved += "." + parameterValue;
+                    keySuffices++;
+                }
+                // if parameter value can't be resolved and strictly
+                else if (strictly)
+                {
+                    return null;
+                }
+            }
+
+            // try appending projectstage
+            if (projectStageAware)
+            {
+                ps = getProjectStage();
+                keyResolved += "." + ps;
+                keySuffices++;
+            }
+
+            // make initial resolution of longest key
+            value = getPropertyValue(keyResolved);
+
+            // try fallbacks if not strictly
+            if (value == null && !strictly)
+            {
+
+                // by the length of the longest resolved key already tried
+                // breaks are left out intentionally
+                switch (keySuffices)
+                {
+
+                    case 2:
+                        // try base.param
+                        keyResolved = keyOriginal + "." + parameterValue;
+                        value = getPropertyValue(keyResolved);
+
+                        if (value != null)
+                        {
+                            return value;
+                        }
+
+                        // try base.ps
+                        ps = getProjectStage();
+                        keyResolved = keyOriginal + "." + ps;
+                        value = getPropertyValue(keyResolved);
+
+                        if (value != null)
+                        {
+                            return value;
+                        }
+
+                    case 1:
+                        // try base
+                        keyResolved = keyOriginal;
+                        value = getPropertyValue(keyResolved);
+                        return value;
+
+                    default:
+                        // the longest key was the base, no fallback
+                        return null;
+                }
+            }
+
+            return value;
+        }
+
+        private T convert(String value)
+        {
+
+            if (value == null)
+            {
+                return null;
+            }
+
+            Object result = null;
+
+            if (this.converter != null)
+            {
+                try
+                {
+                    result = converter.convert(value);
+                }
+                catch (Exception e)
+                {
+                    throw ExceptionUtils.throwAsRuntimeException(e);
+                }
+            }
+            else if (String.class.equals(configEntryType))
+            {
+                result = value;
+            }
+            else if (Class.class.equals(configEntryType))
+            {
+                result = ClassUtils.tryToLoadClassForName(value);
+            }
+            else if (Boolean.class.equals(configEntryType))
+            {
+                Boolean isTrue = "TRUE".equalsIgnoreCase(value);
+                isTrue |= "1".equalsIgnoreCase(value);
+                isTrue |= "YES".equalsIgnoreCase(value);
+                isTrue |= "Y".equalsIgnoreCase(value);
+                isTrue |= "JA".equalsIgnoreCase(value);
+                isTrue |= "J".equalsIgnoreCase(value);
+                isTrue |= "OUI".equalsIgnoreCase(value);
+
+                result = isTrue;
+            }
+            else if (Integer.class.equals(configEntryType))
+            {
+                result = Integer.parseInt(value);
+            }
+            else if (Long.class.equals(configEntryType))
+            {
+                result = Long.parseLong(value);
+            }
+            else if (Float.class.equals(configEntryType))
+            {
+                result = Float.parseFloat(value);
+            }
+            else if (Double.class.equals(configEntryType))
+            {
+                result = Double.parseDouble(value);
+            }
+
+            return (T) result;
+        }
+
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
index b7b69e9..ff0600d 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
@@ -18,32 +18,53 @@
  */
 package org.apache.deltaspike.core.api.config.base;
 
+import org.apache.deltaspike.core.api.config.ConfigResolver;
+
 public interface CoreBaseConfig
 {
     interface BeanManagerDelegation
     {
-        TypedConfig<Boolean> DELEGATE_LOOKUP =
-            new TypedConfig<Boolean>("deltaspike.bean-manager.delegate_lookup", Boolean.TRUE);
+        Boolean DELEGATE_LOOKUP =
+                ConfigResolver.resolve("deltaspike.bean-manager.delegate_lookup")
+                        .as(Boolean.class)
+                        .withCurrentProjectStage(true)
+                        .withDefault(Boolean.TRUE)
+                        .getValue();
     }
 
     interface Interceptor
     {
-        TypedConfig<Integer> PRIORITY =
-            new TypedConfig<Integer>("deltaspike.interceptor.priority", 0);
+        Integer PRIORITY =
+                ConfigResolver.resolve("deltaspike.interceptor.priority")
+                        .as(Integer.class)
+                        .withCurrentProjectStage(true)
+                        .withDefault(0)
+                        .getValue();
     }
 
     interface MBean
     {
-        TypedConfig<Boolean> AUTO_UNREGISTER =
-            new TypedConfig<Boolean>("deltaspike.mbean.auto-unregister", Boolean.TRUE);
+        Boolean AUTO_UNREGISTER =
+                ConfigResolver.resolve("deltaspike.mbean.auto-unregister")
+                        .as(Boolean.class)
+                        .withCurrentProjectStage(true)
+                        .withDefault(Boolean.TRUE)
+                        .getValue();
     }
 
     interface Scope
     {
         interface WindowRestriction
         {
-            TypedConfig<Integer> MAX_COUNT =
-                new TypedConfig<Integer>("deltaspike.scope.window.max-count", 1024);
+            String MAX_COUNT_KEY = "deltaspike.scope.window.max-count";
+
+            Integer MAX_COUNT =
+                    ConfigResolver.resolve(MAX_COUNT_KEY)
+                            .as(Integer.class)
+                            .withCurrentProjectStage(true)
+                            .withDefault(1024)
+                            .getValue();
+
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/TypedConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/TypedConfig.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/TypedConfig.java
deleted file mode 100644
index 168e699..0000000
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/TypedConfig.java
+++ /dev/null
@@ -1,170 +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.deltaspike.core.api.config.base;
-
-import org.apache.deltaspike.core.api.config.ConfigResolver;
-import org.apache.deltaspike.core.util.ClassUtils;
-import org.apache.deltaspike.core.util.ExceptionUtils;
-
-import java.lang.reflect.Method;
-
-public class TypedConfig<T>
-{
-    protected final String key;
-    protected final T defaultValue;
-    protected final Class<? extends T> configEntryType;
-
-    //currently just needed to make this helper more useful for users
-    protected final Object customTypeConverter;
-    protected final Method converterMethod;
-
-    public TypedConfig(String key, T defaultValue)
-    {
-        this(key, defaultValue, null, defaultValue != null ? (Class<T>)defaultValue.getClass() : null);
-    }
-
-    public TypedConfig(String key, T defaultValue, Object customTypeConverter)
-    {
-        this(key, defaultValue, customTypeConverter, defaultValue != null ? (Class<T>)defaultValue.getClass() : null);
-    }
-
-    public TypedConfig(String key, T defaultValue, Class<T> targetType)
-    {
-        this(key, defaultValue, null, targetType);
-    }
-
-    public TypedConfig(String key, T defaultValue, Object customTypeConverter, Class<T> targetType)
-    {
-        if (defaultValue == null && targetType == null)
-        {
-            throw new IllegalArgumentException("'null' isn't supported by this helper for " +
-                "the default-value and target-type");
-        }
-        this.key = key;
-        this.defaultValue = defaultValue;
-        this.configEntryType = getConfigEntryType(targetType, defaultValue);
-
-        this.customTypeConverter = customTypeConverter;
-        this.converterMethod = getCustomTypeConverterMethod(customTypeConverter);
-        validateConfigEntryType();
-    }
-
-    protected Class<? extends T> getConfigEntryType(Class<T> targetType, T defaultValue)
-    {
-        if (targetType != null)
-        {
-            return targetType;
-        }
-        return (Class<? extends T>)defaultValue.getClass();
-    }
-
-    protected Method getCustomTypeConverterMethod(Object customTypeConverter)
-    {
-        Method foundConverterMethod = null;
-        if (customTypeConverter != null)
-        {
-            for (Method currentMethod : customTypeConverter.getClass().getDeclaredMethods())
-            {
-                if (currentMethod.getParameterTypes().length == 1 &&
-                    currentMethod.getParameterTypes()[0].equals(String.class) &&
-                    currentMethod.getReturnType().equals(this.configEntryType))
-                {
-                    foundConverterMethod = currentMethod;
-                    break;
-                }
-            }
-        }
-
-        return foundConverterMethod;
-    }
-
-    protected void validateConfigEntryType()
-    {
-        //same types as supported by DefaultConfigPropertyProducer
-        if (this.converterMethod == null &&
-            !(this.configEntryType.equals(String.class) ||
-                this.configEntryType.equals(Class.class) ||
-                this.configEntryType.equals(Boolean.class) ||
-                this.configEntryType.equals(Integer.class) ||
-                this.configEntryType.equals(Float.class)))
-        {
-            throw new IllegalArgumentException(
-                    this.configEntryType.getName() + " isn't supported out-of-the-box and" +
-                            "no valid (custom) type-converter can be found");
-        }
-    }
-
-    public String getKey()
-    {
-        return key;
-    }
-
-    public T getDefaultValue()
-    {
-        return defaultValue;
-    }
-
-    public T getValue()
-    {
-        String resultString = ConfigResolver.getPropertyValue(
-            this.key, this.defaultValue != null ? this.defaultValue.toString() : null);
-
-        Object result = null;
-
-        if (resultString == null)
-        {
-            return null;
-        }
-
-        //same types as supported by DefaultConfigPropertyProducer
-        else if (String.class.equals(this.configEntryType))
-        {
-            result = resultString;
-        }
-        else if (Class.class.equals(this.configEntryType))
-        {
-            result = ClassUtils.tryToLoadClassForName(resultString);
-        }
-        else if (Boolean.class.equals(this.configEntryType))
-        {
-            result = Boolean.valueOf(resultString);
-        }
-        else if (Integer.class.equals(this.configEntryType))
-        {
-            result = Integer.parseInt(resultString);
-        }
-        else if (Float.class.equals(this.configEntryType))
-        {
-            result = Float.parseFloat(resultString);
-        }
-        else if (this.customTypeConverter != null)
-        {
-            try
-            {
-                result = this.converterMethod.invoke(this.customTypeConverter, resultString);
-            }
-            catch (Exception e)
-            {
-                throw ExceptionUtils.throwAsRuntimeException(e);
-            }
-        }
-
-        return (T)result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
index cfcdc48..992a42b 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
@@ -76,7 +76,7 @@ public class BeanManagerProvider implements Extension
         Method resolvedCdiBeanManagerMethod = null;
         //only init methods if a cdi 1.1+ container is available and the delegation-mode isn't deactivated.
         //deactivation is e.g. useful if owb is used in "parallel mode" in a weld-based server.
-        if (cdiClass != null && !CoreBaseConfig.BeanManagerDelegation.DELEGATE_LOOKUP.getValue())
+        if (cdiClass != null && !CoreBaseConfig.BeanManagerDelegation.DELEGATE_LOOKUP)
         {
 
             try

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/config/BaseConfigPropertyProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/config/BaseConfigPropertyProducer.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/config/BaseConfigPropertyProducer.java
index 1caced6..4526a3c 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/config/BaseConfigPropertyProducer.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/config/BaseConfigPropertyProducer.java
@@ -105,12 +105,35 @@ public abstract class BaseConfigPropertyProducer
             throw new IllegalStateException("producer method called without @ConfigProperty being present!");
         }
 
-        String configuredValue;
-        String defaultValue = configProperty.defaultValue();
+        return getPropertyValue(injectionPoint, String.class);
+    }
 
-        configuredValue = getPropertyValue(configProperty.name(), defaultValue);
+    protected <T> T getPropertyValue(InjectionPoint injectionPoint, Class<T> ipCls)
+    {
+        ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class);
 
-        return configuredValue;
+        if (configProperty == null)
+        {
+            throw new IllegalStateException("producer method called without @ConfigProperty being present!");
+        }
+
+        ConfigResolver.TypedResolver<T> resolver = ConfigResolver.resolve(configProperty.name())
+                .as(ipCls)
+                .withCurrentProjectStage(configProperty.projectStageAware());
+
+        String stringDefault = configProperty.defaultValue();
+        if (!ConfigProperty.NULL.equals(stringDefault))
+        {
+            resolver.withStringDefault(stringDefault);
+        }
+
+        String parameterizedBy = configProperty.parameterizedBy();
+        if (!ConfigProperty.NULL.equals(parameterizedBy))
+        {
+            resolver.parameterizedBy(parameterizedBy);
+        }
+
+        return resolver.getValue();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/ConfigResolverTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/ConfigResolverTest.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/ConfigResolverTest.java
index f8b4313..cc5951f 100644
--- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/ConfigResolverTest.java
+++ b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/ConfigResolverTest.java
@@ -103,11 +103,11 @@ public class ConfigResolverTest
 
         Assert.assertEquals("TestDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendor"));
         Assert.assertEquals("PostgreDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendor2"));
-        Assert.assertEquals("DefaultDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendorX"));
+        Assert.assertEquals("UnitTestDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendorX"));
 
         Assert.assertEquals("TestDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendor", null));
         Assert.assertEquals("PostgreDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendor2", null));
-        Assert.assertEquals("DefaultDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendorX", null));
+        Assert.assertEquals("UnitTestDataSource", ConfigResolver.getPropertyAwarePropertyValue("dataSource", "dbvendorX", null));
         Assert.assertEquals(DEFAULT_VALUE, ConfigResolver.getPropertyAwarePropertyValue("dataSourceX", "dbvendorX", DEFAULT_VALUE));
     }
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TestConfigSource.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TestConfigSource.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TestConfigSource.java
index cb6793f..7f0897c 100644
--- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TestConfigSource.java
+++ b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TestConfigSource.java
@@ -56,21 +56,26 @@ public class TestConfigSource implements ConfigSource
         props.put("dataSource.mysql.Production", "java:/comp/env/MyDs");
         props.put("dataSource.mysql.UnitTest", "TestDataSource");
         props.put("dataSource.postgresql", "PostgreDataSource");
+        props.put("dataSource.UnitTest", "UnitTestDataSource");
         props.put("dataSource", "DefaultDataSource");
 
         // another one
         props.put("dbvendor2.Production", "mysql");
         props.put("dbvendor2", "postgresql");
 
+        props.put("dbvendor3", "h2");
+
         props.put("testkey4.encrypted", "value");
         props.put("testkey4.password", "mysecretvalue");
 
         props.put("deltaspike.test.string-value", "configured");
         props.put("deltaspike.test.integer-value", "5");
+        props.put("deltaspike.test.long-value", "8589934592");
         props.put("deltaspike.test.float-value", "-1.1");
+        props.put("deltaspike.test.double-value", "4e40");
         props.put("deltaspike.test.boolean-value", Boolean.FALSE.toString());
         props.put("deltaspike.test.class-value", "org.apache.deltaspike.test.api.config.TestConfigSource");
-        props.put("deltaspike.test.date-value", "" + System.currentTimeMillis());
+        props.put("deltaspike.test.date-value", "2014-12-24");
         props.put("deltaspike.test.invalid-value", "wrong");
     }
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TypedResolverTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TypedResolverTest.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TypedResolverTest.java
new file mode 100644
index 0000000..38b273f
--- /dev/null
+++ b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/TypedResolverTest.java
@@ -0,0 +1,214 @@
+/*
+ * 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.deltaspike.test.api.config;
+
+import org.apache.deltaspike.core.api.config.ConfigResolver;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.util.ProjectStageProducer;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+public class TypedResolverTest
+{
+    @Before
+    public void init()
+    {
+        ProjectStageProducer.setProjectStage(ProjectStage.UnitTest);
+    }
+
+    @Test
+    public void testValidTypes()
+    {
+        Assert.assertEquals("configured", ConfigResolver.resolve("deltaspike.test.string-value").getValue());
+
+        Assert.assertEquals(Boolean.FALSE, ConfigResolver.resolve("deltaspike.test.boolean-value").as(Boolean.class)
+                .getValue());
+
+        Assert.assertEquals(TestConfigSource.class, ConfigResolver.resolve("deltaspike.test.class-value").as(Class
+                .class).getValue());
+
+        Assert.assertEquals(5l, (int) ConfigResolver.resolve("deltaspike.test.integer-value").as(Integer.class)
+                .getValue());
+
+        Assert.assertEquals(8589934592l, (long) ConfigResolver.resolve("deltaspike.test.long-value").as(Long.class)
+                .getValue());
+
+        Assert.assertEquals(-1.1f, (float) ConfigResolver.resolve("deltaspike.test.float-value").as(Float.class)
+                .getValue(), 0);
+
+        Assert.assertEquals(4e40d, (double) ConfigResolver.resolve("deltaspike.test.double-value").as(Double.class)
+                .getValue(), 0);
+    }
+
+    @Test
+    public void testConverter()
+    {
+        Assert.assertEquals(new GregorianCalendar(2014, 12, 24).getTime(),
+                ConfigResolver.resolve("deltaspike.test.date-value")
+                        .as(Date.class, new TestDateConverter()).getValue());
+
+        // test fallback to default
+        Assert.assertEquals(new GregorianCalendar(2015, 01, 01).getTime(),
+                ConfigResolver.resolve("deltaspike.test.INVALID-date-value")
+                        .as(Date.class, new TestDateConverter())
+                        .withDefault(new GregorianCalendar(2015, 01, 01).getTime())
+                        .getValue());
+    }
+
+    @Test
+    public void testProjectStageAware()
+    {
+        Assert.assertEquals("unittestvalue",
+                ConfigResolver.resolve("testkey")
+                        .withCurrentProjectStage(true)
+                        .getValue());
+
+        Assert.assertEquals("testvalue",
+                ConfigResolver.resolve("testkey")
+                        .withCurrentProjectStage(false)
+                        .getValue());
+
+        // property without PS, with PS-aware
+        Assert.assertEquals("testvalue",
+                ConfigResolver.resolve("testkey2")
+                        .withCurrentProjectStage(true)
+                        .getValue());
+    }
+
+    @Test
+    public void testParameterized()
+    {
+        // param OK, ps OK
+        Assert.assertEquals("TestDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("dbvendor")
+                        .getValue());
+
+        // param OK, NO ps
+        Assert.assertEquals("PostgreDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(false)
+                        .parameterizedBy("dbvendor")
+                        .getValue());
+
+        // param doesn't resolve, ps OK
+        Assert.assertEquals("UnitTestDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("INVALIDPARAMETER")
+                        .getValue());
+
+        // param OK, ps OK, NO base.param.ps, NO base.param, fall back to base.ps
+        Assert.assertEquals("UnitTestDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("dbvendor3")
+                        .getValue());
+
+        // param OK, NO ps, base.param undefined, fall back to base
+        Assert.assertEquals("DefaultDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(false)
+                        .parameterizedBy("dbvendor3")
+                        .getValue());
+    }
+
+    @Test
+    public void testDefault()
+    {
+        Assert.assertEquals(10l,
+                (long) ConfigResolver.resolve("INVALIDKEY")
+                .as(Long.class)
+                .withDefault(10l).getValue());
+
+        // string default
+        Assert.assertEquals(10l,
+                (long) ConfigResolver.resolve("INVALIDKEY")
+                        .as(Long.class)
+                        .withStringDefault("10").getValue());
+    }
+
+    @Test
+    public void testStrict()
+    {
+        Assert.assertEquals("TestDataSource",
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("dbvendor")
+                        .strictly(true)
+                        .getValue());
+
+        // no base.param, no value for base.param.ps
+        Assert.assertEquals(null,
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("dbvendor3")
+                        .strictly(true)
+                        .getValue());
+
+        // valid base.param, but no base.param.ps
+        Assert.assertEquals(null,
+                ConfigResolver.resolve("dataSource")
+                        .withCurrentProjectStage(true)
+                        .parameterizedBy("dbvendor2")
+                        .strictly(true)
+                        .getValue());
+    }
+
+    @Test
+    public void testGets()
+    {
+        ConfigResolver.TypedResolver<String> resolver = ConfigResolver.resolve("dataSource")
+                .withCurrentProjectStage(true)
+                .parameterizedBy("dbvendor")
+                .withDefault("TESTDEFAULT");
+
+        Assert.assertEquals("TestDataSource", resolver.getValue());
+        Assert.assertEquals("dataSource", resolver.getKey());
+        Assert.assertEquals("TESTDEFAULT", resolver.getDefaultValue());
+        Assert.assertEquals("dataSource.mysql.UnitTest", resolver.getResolvedKey());
+
+
+        ConfigResolver.TypedResolver<String> resolver2 = ConfigResolver.resolve("testkey2")
+                .withCurrentProjectStage(true)
+                .parameterizedBy("INVALIDPARAMETER");
+
+
+        Assert.assertEquals("testvalue", resolver2.getValue());
+        Assert.assertEquals("testkey2", resolver2.getResolvedKey());
+    }
+
+    public static class TestDateConverter implements ConfigResolver.Converter<Date> {
+
+        @Override
+        public Date convert(String value)
+        {
+            String[] parts = value.split("-");
+            return new GregorianCalendar(Integer.valueOf(parts[0]), Integer.valueOf(parts[1]),
+                    Integer.valueOf(parts[2])).getTime();
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TestConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TestConfig.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TestConfig.java
deleted file mode 100644
index 9be2b17..0000000
--- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TestConfig.java
+++ /dev/null
@@ -1,70 +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.deltaspike.test.api.config.typed;
-
-import org.apache.deltaspike.core.api.config.base.TypedConfig;
-
-import java.util.Date;
-
-public interface TestConfig
-{
-    interface Valid
-    {
-        TypedConfig<String> STRING_VALUE =
-            new TypedConfig<String>("deltaspike.test.string-value", "default");
-
-        TypedConfig<Integer> INTEGER_VALUE =
-            new TypedConfig<Integer>("deltaspike.test.integer-value", 14);
-
-        TypedConfig<Float> FLOAT_VALUE =
-            new TypedConfig<Float>("deltaspike.test.float-value", 1.1F);
-
-        TypedConfig<Boolean> BOOLEAN_VALUE =
-            new TypedConfig<Boolean>("deltaspike.test.boolean-value", Boolean.TRUE);
-
-        TypedConfig<Class> CLASS_VALUE =
-            new TypedConfig<Class>("deltaspike.test.class-value", TypedConfigTest.class);
-
-        TypedConfig<Date> CUSTOM_TYPE_VALUE =
-            new TypedConfig<Date>("deltaspike.test.date-value", new Date(1983, 4, 14), new DateConverter());
-
-        TypedConfig<Integer> INTEGER_VALUE_NO_DEFAULT =
-            new TypedConfig<Integer>("deltaspike.test.integer-no-default-value", null, Integer.class);
-    }
-
-    interface InvalidConfig
-    {
-        TypedConfig<Integer> CONFIG_WITHOUT_TYPE_INFORMATION =
-            new TypedConfig<Integer>("deltaspike.test.invalid-config", null);
-    }
-
-    interface InvalidConfigValue
-    {
-        TypedConfig<Integer> WRONG_VALUE =
-            new TypedConfig<Integer>("deltaspike.test.invalid-value", 10);
-    }
-
-    static class DateConverter
-    {
-        public Date convert(String value)
-        {
-            return new Date(new Long(value));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TypedConfigTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TypedConfigTest.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TypedConfigTest.java
deleted file mode 100644
index 3f552fa..0000000
--- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/test/api/config/typed/TypedConfigTest.java
+++ /dev/null
@@ -1,130 +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.deltaspike.test.api.config.typed;
-
-import org.apache.deltaspike.core.api.config.base.CoreBaseConfig;
-import org.apache.deltaspike.core.util.ExceptionUtils;
-import org.apache.deltaspike.test.api.config.TestConfigSource;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.Date;
-
-public class TypedConfigTest
-{
-    @Test
-    public void testConfiguredDefaultValue()
-    {
-        Integer configuredValue = CoreBaseConfig.Interceptor.PRIORITY.getValue();
-        Assert.assertEquals(new Integer(0), configuredValue);
-
-        Integer defaultValue = CoreBaseConfig.Interceptor.PRIORITY.getDefaultValue();
-        Assert.assertEquals(new Integer(0), defaultValue);
-    }
-
-    @Test
-    public void testStringValue()
-    {
-        String configuredValue = TestConfig.Valid.STRING_VALUE.getValue();
-        Assert.assertEquals("configured", configuredValue);
-
-        String defaultValue = TestConfig.Valid.STRING_VALUE.getDefaultValue();
-        Assert.assertEquals("default", defaultValue);
-    }
-
-    @Test
-    public void testIntegerValue()
-    {
-        Integer configuredValue = TestConfig.Valid.INTEGER_VALUE.getValue();
-        Assert.assertEquals(new Integer(5), configuredValue);
-
-        Integer defaultValue = TestConfig.Valid.INTEGER_VALUE.getDefaultValue();
-        Assert.assertEquals(new Integer(14), defaultValue);
-    }
-
-    @Test
-    public void testFloatValue()
-    {
-        Float configuredValue = TestConfig.Valid.FLOAT_VALUE.getValue();
-        Assert.assertEquals(new Float(-1.1), configuredValue);
-
-        Float defaultValue = TestConfig.Valid.FLOAT_VALUE.getDefaultValue();
-        Assert.assertEquals(new Float(1.1), defaultValue);
-    }
-
-    @Test
-    public void testBooleanValue()
-    {
-        Boolean configuredValue = TestConfig.Valid.BOOLEAN_VALUE.getValue();
-        Assert.assertEquals(Boolean.FALSE, configuredValue);
-
-        Boolean defaultValue = TestConfig.Valid.BOOLEAN_VALUE.getDefaultValue();
-        Assert.assertEquals(Boolean.TRUE, defaultValue);
-    }
-
-    @Test
-    public void testClassValue()
-    {
-        Class configuredValue = TestConfig.Valid.CLASS_VALUE.getValue();
-        Assert.assertEquals(TestConfigSource.class, configuredValue);
-
-        Class defaultValue = TestConfig.Valid.CLASS_VALUE.getDefaultValue();
-        Assert.assertEquals(getClass(), defaultValue);
-    }
-
-    @Test
-    public void testCustomType()
-    {
-        Date configuredValue = TestConfig.Valid.CUSTOM_TYPE_VALUE.getValue();
-        Assert.assertEquals(configuredValue.getYear(), new Date().getYear());
-
-        Date defaultValue = TestConfig.Valid.CUSTOM_TYPE_VALUE.getDefaultValue();
-        Assert.assertEquals(new Date(1983, 4, 14), defaultValue);
-    }
-
-    @Test
-    public void testIntegerValueNoValue()
-    {
-        Integer configuredValue = TestConfig.Valid.INTEGER_VALUE_NO_DEFAULT.getValue();
-        Assert.assertEquals(null, configuredValue);
-
-        Integer defaultValue = TestConfig.Valid.INTEGER_VALUE_NO_DEFAULT.getDefaultValue();
-        Assert.assertEquals(null, defaultValue);
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void testInvalidConfigEntry()
-    {
-        try
-        {
-            TestConfig.InvalidConfig.CONFIG_WITHOUT_TYPE_INFORMATION.getValue();
-        }
-        catch (ExceptionInInitializerError e)
-        {
-            throw ExceptionUtils.throwAsRuntimeException(e.getCause());
-        }
-        Assert.fail();
-    }
-
-    @Test(expected = NumberFormatException.class)
-    public void testWrongConfigValue()
-    {
-        TestConfig.InvalidConfigValue.WRONG_VALUE.getValue();
-    }
-}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/DefaultConfigPropertyProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/DefaultConfigPropertyProducer.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/DefaultConfigPropertyProducer.java
index 4babfa9..8546c71 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/DefaultConfigPropertyProducer.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/DefaultConfigPropertyProducer.java
@@ -46,25 +46,25 @@ public class DefaultConfigPropertyProducer extends BaseConfigPropertyProducer
     @Produces
     @Dependent
     @ConfigProperty(name = "ignored") // we actually don't need the name
-    public Integer produceIntegerConfiguration(InjectionPoint injectionPoint)
+    public Class produceClassConfiguration(InjectionPoint injectionPoint)
     {
-        String configuredValue = getStringPropertyValue(injectionPoint);
-        if (configuredValue == null)
-        {
-            return null;
-        }
+        return getPropertyWithException(injectionPoint, Class.class);
+    }
 
-        try
-        {
-            return Integer.parseInt(configuredValue);
-        }
-        catch (NumberFormatException nfe)
-        {
-            ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class);
-            throw new RuntimeException("Error while converting Integer property '" + configProperty.name() +
-                    "' value: " + configuredValue + " happening in bean " + injectionPoint.getBean() , nfe);
-        }
+    @Produces
+    @Dependent
+    @ConfigProperty(name = "ignored") // we actually don't need the name
+    public Boolean produceBooleanConfiguration(InjectionPoint injectionPoint)
+    {
+        return getPropertyWithException(injectionPoint, Boolean.class);
+    }
 
+    @Produces
+    @Dependent
+    @ConfigProperty(name = "ignored") // we actually don't need the name
+    public Integer produceIntegerConfiguration(InjectionPoint injectionPoint)
+    {
+        return getPropertyWithException(injectionPoint, Integer.class);
     }
 
     @Produces
@@ -72,68 +72,38 @@ public class DefaultConfigPropertyProducer extends BaseConfigPropertyProducer
     @ConfigProperty(name = "ignored") // we actually don't need the name
     public Long produceLongConfiguration(InjectionPoint injectionPoint)
     {
-        String configuredValue = getStringPropertyValue(injectionPoint);
-        if (configuredValue == null)
-        {
-            return null;
-        }
-
-        try
-        {
-            return Long.parseLong(configuredValue);
-        }
-        catch (NumberFormatException nfe)
-        {
-            ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class);
-            throw new RuntimeException("Error while converting Long property '" + configProperty.name() +
-                    "' value: " + configuredValue + " happening in bean " + injectionPoint.getBean() , nfe);
-        }
+        return getPropertyWithException(injectionPoint, Long.class);
     }
 
     @Produces
     @Dependent
     @ConfigProperty(name = "ignored") // we actually don't need the name
-    public Boolean produceBooleanConfiguration(InjectionPoint injectionPoint)
+    public Float produceFloatConfiguration(InjectionPoint injectionPoint)
     {
-        String configuredValue = getStringPropertyValue(injectionPoint);
-        if (configuredValue == null)
-        {
-            return null;
-        }
-
-        Boolean isTrue = "TRUE".equalsIgnoreCase(configuredValue);
-        isTrue |= "1".equalsIgnoreCase(configuredValue);
-        isTrue |= "YES".equalsIgnoreCase(configuredValue);
-        isTrue |= "Y".equalsIgnoreCase(configuredValue);
-        isTrue |= "JA".equalsIgnoreCase(configuredValue);
-        isTrue |= "J".equalsIgnoreCase(configuredValue);
-        isTrue |= "OUI".equalsIgnoreCase(configuredValue);
+        return getPropertyWithException(injectionPoint, Float.class);
 
-        return isTrue;
     }
 
     @Produces
     @Dependent
     @ConfigProperty(name = "ignored") // we actually don't need the name
-    public Float produceFloatConfiguration(InjectionPoint injectionPoint)
+    public Double produceDoubleConfiguration(InjectionPoint injectionPoint)
     {
-        String configuredValue = getStringPropertyValue(injectionPoint);
+        return getPropertyWithException(injectionPoint, Double.class);
 
-        if (configuredValue == null)
-        {
-            return null;
-        }
+    }
 
+    private <T> T getPropertyWithException(InjectionPoint ip, Class<T> ipCls)
+    {
         try
         {
-            return Float.parseFloat(configuredValue);
+            return getPropertyValue(ip, ipCls);
         }
-        catch (NumberFormatException nfe)
+        catch (RuntimeException rte)
         {
-            ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class);
-            throw new RuntimeException("Error while converting Float property '" + configProperty.name() +
-                    "' value: " + configuredValue + " happening in bean " + injectionPoint.getBean() , nfe);
+            ConfigProperty configProperty = getAnnotation(ip, ConfigProperty.class);
+            throw new RuntimeException("Error while converting property '" + configProperty.name() +
+                    "' happening in bean " + ip.getBean(), rte);
         }
-
     }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/extension/ExcludeExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/extension/ExcludeExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/extension/ExcludeExtension.java
index 3aa3ede..7287e74 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/extension/ExcludeExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/extension/ExcludeExtension.java
@@ -118,7 +118,7 @@ public class ExcludeExtension implements Extension, Deactivatable
 
             if (isGlobalAlternativeActivated)
             {
-                int priorityValue = CoreBaseConfig.Interceptor.PRIORITY.getValue();
+                int priorityValue = CoreBaseConfig.Interceptor.PRIORITY;
                 priorityAnnotationInstance = AnnotationInstanceUtils.getPriorityAnnotationInstance(priorityValue);
             }
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interceptor/GlobalInterceptorExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interceptor/GlobalInterceptorExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interceptor/GlobalInterceptorExtension.java
index 7531e49..03e53c9 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interceptor/GlobalInterceptorExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interceptor/GlobalInterceptorExtension.java
@@ -47,7 +47,7 @@ public class GlobalInterceptorExtension implements Deactivatable, Extension
             return;
         }
 
-        int priorityValue = CoreBaseConfig.Interceptor.PRIORITY.getValue();
+        int priorityValue = CoreBaseConfig.Interceptor.PRIORITY;
         priorityAnnotationInstance = AnnotationInstanceUtils.getPriorityAnnotationInstance(priorityValue);
     }
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
index d0006ef..6f2fc4d 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
@@ -122,7 +122,7 @@ public class MBeanExtension implements Extension, Deactivatable
         final Annotation[] qualifiers = qualifiers(bean.getAnnotatedBeanClass(), bm);
         final DynamicMBeanWrapper mbean = new DynamicMBeanWrapper(clazz, normalScoped, qualifiers);
         final MBeanServer server = mBeanServer();
-        if (server.isRegistered(objectName) && CoreBaseConfig.MBean.AUTO_UNREGISTER.getValue())
+        if (server.isRegistered(objectName) && CoreBaseConfig.MBean.AUTO_UNREGISTER)
         {
             server.unregisterMBean(objectName);
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContextQuotaHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContextQuotaHandler.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContextQuotaHandler.java
index 8e8eed4..d91006d 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContextQuotaHandler.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContextQuotaHandler.java
@@ -41,7 +41,7 @@ public class DefaultWindowContextQuotaHandler implements WindowContextQuotaHandl
     @PostConstruct
     protected void init()
     {
-        this.maxWindowContextCount = CoreBaseConfig.Scope.WindowRestriction.MAX_COUNT.getValue();
+        this.maxWindowContextCount = CoreBaseConfig.Scope.WindowRestriction.MAX_COUNT;
     }
 
     public synchronized /*no issue due to session-scoped instance*/ void checkWindowContextQuota(String windowId)

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/BaseTestConfigProperty.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/BaseTestConfigProperty.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/BaseTestConfigProperty.java
index 5c25836..18377b4 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/BaseTestConfigProperty.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/BaseTestConfigProperty.java
@@ -34,6 +34,17 @@ public class BaseTestConfigProperty
     @Test
     public void testInjectConfig()
     {
-        Assert.assertEquals("somevalue", myBean.getConfig());
+        Assert.assertEquals("psAwareStringValue", myBean.getStringConfig());
+        Assert.assertEquals("DEFAULT", myBean.getStringConfigWithDefault());
+        Assert.assertEquals("stringValue", myBean.getStringConfigWithoutProjectStage());
+        Assert.assertEquals("parameterizedPsAwareStringValue", myBean.getStringConfigParameterized());
+
+        Assert.assertEquals(false, myBean.getBooleanConfig());
+        Assert.assertEquals(MyBean.class, myBean.getClassConfig());
+        Assert.assertEquals(5, myBean.getIntConfig());
+        Assert.assertEquals(8589934592l, myBean.getLongConfig());
+        Assert.assertEquals(-1.1f, myBean.getFloatConfig(), 0);
+        Assert.assertEquals(4e40, myBean.getDoubleConfig(), 0);
+
     }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyEARTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyEARTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyEARTest.java
index be0683a..c25aff8 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyEARTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyEARTest.java
@@ -25,6 +25,7 @@ import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
@@ -46,7 +47,9 @@ public class ConfigPropertyEARTest extends BaseTestConfigProperty
                         MyBean.class, MyCustomEarPropertyFileConfig.class)
                 .addAsResource(CONFIG_FILE_NAME)
                 .addAsServiceProvider(PropertyFileConfig.class, MyCustomEarPropertyFileConfig.class)
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+                .addAsManifestResource(new StringAsset("org.apache.deltaspike.ProjectStage = UnitTest"),
+                        "apache-deltaspike.properties");
 
         WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
                 .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java
index 5bc90e3..39693d0 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/ConfigPropertyWARTest.java
@@ -24,6 +24,7 @@ import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -40,7 +41,9 @@ public class ConfigPropertyWARTest extends BaseTestConfigProperty
                 .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
                 .addPackage(ConfigPropertyWARTest.class.getPackage())
                 .addAsResource(CONFIG_FILE_NAME)
-                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+                .addAsWebInfResource(new StringAsset("org.apache.deltaspike.ProjectStage = UnitTest"),
+                        "classes/META-INF/apache-deltaspike.properties");
 
     }
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/MyBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/MyBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/MyBean.java
index b6f2e43..a097d86 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/MyBean.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/propertyconfigsource/MyBean.java
@@ -28,12 +28,93 @@ public class MyBean
 {
 
     @Inject
-    @ConfigProperty(name = "some.propertykey")
-    private String myConfig;
+    @ConfigProperty(name = "configproperty.test.string")
+    private String stringConfig;
 
-    public String getConfig()
+    @Inject
+    @ConfigProperty(name = "INVALIDKEY", defaultValue = "DEFAULT")
+    private String stringConfigWithDefault;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.string", projectStageAware = false)
+    private String stringConfigWithoutProjectStage;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.string", projectStageAware = true,
+            parameterizedBy = "configproperty.test.param")
+    private String stringConfigParameterized;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.boolean")
+    private Boolean booleanConfig;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.class")
+    private Class classConfig;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.int")
+    private Integer intConfig;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.long")
+    private Long longConfig;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.float")
+    private Float floatConfig;
+
+    @Inject
+    @ConfigProperty(name = "configproperty.test.double")
+    private Double doubleConfig;
+
+    public String getStringConfig()
+    {
+        return stringConfig;
+    }
+
+    public String getStringConfigWithDefault()
+    {
+        return stringConfigWithDefault;
+    }
+
+    public String getStringConfigWithoutProjectStage()
+    {
+        return stringConfigWithoutProjectStage;
+    }
+
+    public String getStringConfigParameterized()
+    {
+        return stringConfigParameterized;
+    }
+
+    public boolean getBooleanConfig()
+    {
+        return booleanConfig;
+    }
+
+    public Class getClassConfig()
+    {
+        return classConfig;
+    }
+
+    public int getIntConfig()
+    {
+        return intConfig;
+    }
+
+    public long getLongConfig()
+    {
+        return longConfig;
+    }
+
+    public float getFloatConfig()
+    {
+        return floatConfig;
+    }
+
+    public double getDoubleConfig()
     {
-        return myConfig;
+        return doubleConfig;
     }
-    
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/core/impl/src/test/resources/myconfig.properties
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/resources/myconfig.properties b/deltaspike/core/impl/src/test/resources/myconfig.properties
index aa791c2..65c1303 100644
--- a/deltaspike/core/impl/src/test/resources/myconfig.properties
+++ b/deltaspike/core/impl/src/test/resources/myconfig.properties
@@ -20,3 +20,14 @@
 some.propertykey = somevalue
 
 some.boottimekey = wrongvalue
+
+configproperty.test.string = stringValue
+configproperty.test.string.UnitTest = psAwareStringValue
+configproperty.test.string.paramvalue.UnitTest = parameterizedPsAwareStringValue
+configproperty.test.param = paramvalue
+configproperty.test.boolean = false
+configproperty.test.class = org.apache.deltaspike.test.core.api.config.propertyconfigsource.MyBean
+configproperty.test.int = 5
+configproperty.test.long = 8589934592
+configproperty.test.float = -1.1
+configproperty.test.double = 4e40

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/base/JsfBaseConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/base/JsfBaseConfig.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/base/JsfBaseConfig.java
index 734f395..7c10391 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/base/JsfBaseConfig.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/base/JsfBaseConfig.java
@@ -18,8 +18,8 @@
  */
 package org.apache.deltaspike.jsf.api.config.base;
 
+import org.apache.deltaspike.core.api.config.ConfigResolver;
 import org.apache.deltaspike.core.api.config.base.CoreBaseConfig;
-import org.apache.deltaspike.core.api.config.base.TypedConfig;
 import org.apache.deltaspike.jsf.api.config.view.Folder;
 import org.apache.deltaspike.jsf.api.config.view.View;
 
@@ -27,35 +27,51 @@ public interface JsfBaseConfig
 {
     interface ViewConfig
     {
-        TypedConfig<String> CUSTOM_DEFAULT_BASE_PATH_BUILDER =
-            new TypedConfig<String>(View.DefaultBasePathBuilder.class.getName(), null, String.class);
+        String CUSTOM_DEFAULT_BASE_PATH_BUILDER = ConfigResolver.resolve(View.DefaultBasePathBuilder.class.getName())
+                .withCurrentProjectStage(true)
+                .getValue();
 
-        TypedConfig<String> CUSTOM_DEFAULT_FILE_NAME_BUILDER =
-            new TypedConfig<String>(View.DefaultFileNameBuilder.class.getName(), null, String.class);
+        String CUSTOM_DEFAULT_FILE_NAME_BUILDER = ConfigResolver.resolve(View.DefaultFileNameBuilder.class.getName())
+                .withCurrentProjectStage(true)
+                .getValue();
 
-        TypedConfig<String> CUSTOM_DEFAULT_EXTENSION_BUILDER =
-            new TypedConfig<String>(View.DefaultExtensionBuilder.class.getName(), null, String.class);
+        String CUSTOM_DEFAULT_EXTENSION_BUILDER = ConfigResolver.resolve(View.DefaultExtensionBuilder.class.getName())
+                .withCurrentProjectStage(true)
+                .getValue();
 
-        TypedConfig<String> CUSTOM_DEFAULT_FOLDER_NAME_BUILDER =
-            new TypedConfig<String>(Folder.DefaultFolderNameBuilder.class.getName(), null, String.class);
+        String CUSTOM_DEFAULT_FOLDER_NAME_BUILDER = ConfigResolver
+                .resolve(Folder.DefaultFolderNameBuilder.class.getName())
+                .withCurrentProjectStage(true)
+                .getValue();
     }
 
     interface Scope
     {
         interface WindowRestriction
         {
-            TypedConfig<Integer> MAX_COUNT =
-                new TypedConfig<Integer>(CoreBaseConfig.Scope.WindowRestriction.MAX_COUNT.getKey(), 64);
+            int ID_MAX_LENGTH_DEFAULT = 10;
+
+            Integer MAX_COUNT = ConfigResolver.resolve(CoreBaseConfig.Scope.WindowRestriction.MAX_COUNT_KEY)
+                    .as(Integer.class)
+                    .withCurrentProjectStage(true)
+                    .withDefault(64)
+                    .getValue();
 
             //10 is enough for the integer generated by DefaultClientWindow#generateNewWindowId - see DELTASPIKE-752
-            TypedConfig<Integer> ID_MAX_LENGTH =
-                new TypedConfig<Integer>("deltaspike.window-id.max_length", 10);
+            Integer ID_MAX_LENGTH = ConfigResolver.resolve("deltaspike.window-id.max_length")
+                    .as(Integer.class)
+                    .withCurrentProjectStage(true)
+                    .withDefault(ID_MAX_LENGTH_DEFAULT)
+                    .getValue();
         }
 
         interface ViewDelegation
         {
-            TypedConfig<Boolean> DELEGATE_TO_JSF =
-                new TypedConfig<Boolean>("deltaspike.scope.view.delegate", Boolean.TRUE);
+            Boolean DELEGATE_TO_JSF = ConfigResolver.resolve("deltaspike.scope.view.delegate")
+                    .as(Boolean.class)
+                    .withCurrentProjectStage(true)
+                    .withDefault(Boolean.TRUE)
+                    .getValue();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/Folder.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/Folder.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/Folder.java
index 481c732..93cc5cd 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/Folder.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/Folder.java
@@ -114,7 +114,7 @@ public @interface Folder
             if (DefaultFolderNameBuilder.class.equals(folder.folderNameBuilder()))
             {
                 String customDefaultFolderNameBuilderClassName =
-                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FOLDER_NAME_BUILDER.getValue();
+                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FOLDER_NAME_BUILDER;
 
                 if (customDefaultFolderNameBuilderClassName != null)
                 {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/View.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/View.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/View.java
index 848e5c4..3e6bbe7 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/View.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/view/View.java
@@ -242,7 +242,7 @@ public @interface View
             if (DefaultBasePathBuilder.class.equals(view.basePathBuilder()))
             {
                 String customDefaultBasePathBuilderClassName =
-                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_BASE_PATH_BUILDER.getValue();
+                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_BASE_PATH_BUILDER;
 
                 if (customDefaultBasePathBuilderClassName != null)
                 {
@@ -267,7 +267,7 @@ public @interface View
             if (DefaultFileNameBuilder.class.equals(view.fileNameBuilder()))
             {
                 String customDefaultFileNameBuilderClassName =
-                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FILE_NAME_BUILDER.getValue();
+                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FILE_NAME_BUILDER;
 
                 if (customDefaultFileNameBuilderClassName != null)
                 {
@@ -292,7 +292,7 @@ public @interface View
             if (DefaultExtensionBuilder.class.equals(view.extensionBuilder()))
             {
                 String customDefaultExtensionBuilderClassName =
-                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_EXTENSION_BUILDER.getValue();
+                    JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_EXTENSION_BUILDER;
 
                 if (customDefaultExtensionBuilderClassName != null)
                 {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/FolderLiteral.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/FolderLiteral.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/FolderLiteral.java
index ebd8a92..f120ed5 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/FolderLiteral.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/FolderLiteral.java
@@ -48,7 +48,7 @@ public class FolderLiteral extends AnnotationLiteral<Folder> implements Folder
         }
 
         final String customDefaultFolderNameBuilderClassName =
-            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FOLDER_NAME_BUILDER.getValue();
+            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FOLDER_NAME_BUILDER;
 
         if (customDefaultFolderNameBuilderClassName != null)
         {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/ViewLiteral.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/ViewLiteral.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/ViewLiteral.java
index 3cfa269..1565c67 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/ViewLiteral.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/literal/ViewLiteral.java
@@ -63,7 +63,7 @@ public class ViewLiteral extends AnnotationLiteral<View> implements View
         }
 
         final String customDefaultBasePathBuilderClassName =
-            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_BASE_PATH_BUILDER.getValue();
+            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_BASE_PATH_BUILDER;
 
         if (customDefaultBasePathBuilderClassName != null)
         {
@@ -76,7 +76,7 @@ public class ViewLiteral extends AnnotationLiteral<View> implements View
 
 
         final String customDefaultFileNameBuilderClassName =
-            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FILE_NAME_BUILDER.getValue();
+            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_FILE_NAME_BUILDER;
 
         if (customDefaultFileNameBuilderClassName != null)
         {
@@ -89,7 +89,7 @@ public class ViewLiteral extends AnnotationLiteral<View> implements View
 
 
         final String customDefaultExtensionBuilderClassName =
-            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_EXTENSION_BUILDER.getValue();
+            JsfBaseConfig.ViewConfig.CUSTOM_DEFAULT_EXTENSION_BUILDER;
 
         if (customDefaultExtensionBuilderClassName != null)
         {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/spi/scope/window/DefaultClientWindowConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/spi/scope/window/DefaultClientWindowConfig.java b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/spi/scope/window/DefaultClientWindowConfig.java
index c4cfaa0..d3e02b8 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/spi/scope/window/DefaultClientWindowConfig.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/spi/scope/window/DefaultClientWindowConfig.java
@@ -81,7 +81,7 @@ public class DefaultClientWindowConfig implements ClientWindowConfig
     protected void init()
     {
         this.defaultClientWindowRenderMode = this.jsfModuleConfig.getDefaultWindowMode();
-        this.maxWindowContextCount = JsfBaseConfig.Scope.WindowRestriction.MAX_COUNT.getValue();
+        this.maxWindowContextCount = JsfBaseConfig.Scope.WindowRestriction.MAX_COUNT;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/ClientWindowHelper.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/ClientWindowHelper.java b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/ClientWindowHelper.java
index b1ef2d8..68e6fa6 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/ClientWindowHelper.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/ClientWindowHelper.java
@@ -163,9 +163,9 @@ public abstract class ClientWindowHelper
 
     public static int getMaxWindowIdLength()
     {
-        int result = JsfBaseConfig.Scope.WindowRestriction.ID_MAX_LENGTH.getValue();
+        int result = JsfBaseConfig.Scope.WindowRestriction.ID_MAX_LENGTH;
 
-        if (result > JsfBaseConfig.Scope.WindowRestriction.ID_MAX_LENGTH.getDefaultValue())
+        if (result > JsfBaseConfig.Scope.WindowRestriction.ID_MAX_LENGTH_DEFAULT)
         {
             if (LOG.isLoggable(Level.WARNING))
             {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
index 803fbd2..2edb47b 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/util/JsfUtils.java
@@ -362,7 +362,7 @@ public abstract class JsfUtils
     public static boolean isViewScopeDelegationEnabled()
     {
         return ClassUtils.tryToLoadClassForName("javax.faces.view.ViewScoped") != null &&
-            JsfBaseConfig.Scope.ViewDelegation.DELEGATE_TO_JSF.getValue();
+            JsfBaseConfig.Scope.ViewDelegation.DELEGATE_TO_JSF;
     }
 
     public static void logWrongModuleUsage(String name)

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/CdiAwareJobFactory.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/CdiAwareJobFactory.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/CdiAwareJobFactory.java
index 05909aa..4a840de 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/CdiAwareJobFactory.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/CdiAwareJobFactory.java
@@ -32,7 +32,7 @@ public class CdiAwareJobFactory implements JobFactory
 
     public CdiAwareJobFactory()
     {
-        String defaultJobFactoryName = SchedulerBaseConfig.JobCustomization.DEFAULT_JOB_FACTORY_CLASS_NAME.getValue();
+        String defaultJobFactoryName = SchedulerBaseConfig.JobCustomization.DEFAULT_JOB_FACTORY_CLASS_NAME;
 
         defaultFactory = ClassUtils.tryToInstantiateClassForName(defaultJobFactoryName, JobFactory.class);
     }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/25b2b8cc/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
index 5de0578..74782e1 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
@@ -125,13 +125,13 @@ public class QuartzScheduler implements Scheduler<Job>
         try
         {
             this.scheduler = schedulerFactory.getScheduler();
-            if (SchedulerBaseConfig.Lifecycle.START_SCOPES_PER_JOB.getValue())
+            if (SchedulerBaseConfig.Lifecycle.START_SCOPES_PER_JOB)
             {
                 this.scheduler.getListenerManager().addJobListener(new InjectionAwareJobListener());
             }
             if (!this.scheduler.isStarted())
             {
-                this.scheduler.startDelayed(SchedulerBaseConfig.Lifecycle.DELAYED_START_IN_SECONDS.getValue());
+                this.scheduler.startDelayed(SchedulerBaseConfig.Lifecycle.DELAYED_START_IN_SECONDS);
             }
         }
         catch (SchedulerException e)
@@ -143,7 +143,7 @@ public class QuartzScheduler implements Scheduler<Job>
     protected ResourceBundle loadCustomQuartzConfig()
     {
         //don't use quartz.properties as default-value
-        String configFile = SchedulerBaseConfig.SCHEDULER_CONFIG_FILE.getValue();
+        String configFile = SchedulerBaseConfig.SCHEDULER_CONFIG_FILE;
         return PropertyFileUtils.getResourceBundle(configFile);
     }
 
@@ -154,7 +154,7 @@ public class QuartzScheduler implements Scheduler<Job>
         {
             if (this.scheduler != null && this.scheduler.isStarted())
             {
-                this.scheduler.shutdown(SchedulerBaseConfig.Lifecycle.FORCE_STOP.getValue());
+                this.scheduler.shutdown(SchedulerBaseConfig.Lifecycle.FORCE_STOP);
                 this.scheduler = null;
             }
         }


Mime
View raw message