You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/09/29 09:01:24 UTC
[19/21] incubator-tamaya git commit: TAMAYA-113: Remove Java 8
related parts - basic work done.
TAMAYA-113: Remove Java 8 related parts - basic work done.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/b6dc2eed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/b6dc2eed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/b6dc2eed
Branch: refs/heads/master
Commit: b6dc2eeda776b2db351c18074aaad663b1c0e4bf
Parents: d8c56f8
Author: anatole <an...@apache.org>
Authored: Tue Sep 29 01:31:22 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Sep 29 01:31:26 2015 +0200
----------------------------------------------------------------------
api/pom.xml | 44 ++
.../java/org/apache/tamaya/ConfigException.java | 44 ++
.../java/org/apache/tamaya/ConfigOperator.java | 37 ++
.../java/org/apache/tamaya/ConfigQuery.java | 36 ++
.../java/org/apache/tamaya/Configuration.java | 102 +++++
.../apache/tamaya/ConfigurationProvider.java | 93 ++++
.../java/org/apache/tamaya/TypeLiteral.java | 202 +++++++++
.../apache/tamaya/spi/ConfigurationContext.java | 155 +++++++
.../tamaya/spi/ConfigurationContextBuilder.java | 166 +++++++
.../tamaya/spi/ConfigurationProviderSpi.java | 74 +++
.../apache/tamaya/spi/PropertyConverter.java | 41 ++
.../org/apache/tamaya/spi/PropertyFilter.java | 49 ++
.../org/apache/tamaya/spi/PropertySource.java | 125 ++++++
.../tamaya/spi/PropertySourceProvider.java | 43 ++
.../spi/PropertyValueCombinationPolicy.java | 63 +++
.../org/apache/tamaya/spi/ServiceContext.java | 57 +++
.../tamaya/spi/ServiceContextManager.java | 116 +++++
.../org/apache/tamaya/ConfigExceptionTest.java | 45 ++
.../org/apache/tamaya/ConfigurationTest.java | 64 +++
.../org/apache/tamaya/TestConfiguration.java | 101 +++++
.../tamaya/TestConfigurationProvider.java | 56 +++
.../java/org/apache/tamaya/TypeLiteralTest.java | 61 +++
.../apache/tamaya/spi/ServiceContextTest.java | 98 ++++
.../apache/tamaya/spi/TestServiceContext.java | 90 ++++
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 +
.../org.apache.tamaya.spi.ServiceContext | 19 +
attic/java8/api/pom.xml | 43 ++
.../java/org/apache/tamaya/ConfigException.java | 46 ++
.../java/org/apache/tamaya/ConfigOperator.java | 38 ++
.../java/org/apache/tamaya/ConfigQuery.java | 38 ++
.../java/org/apache/tamaya/Configuration.java | 232 ++++++++++
.../apache/tamaya/ConfigurationProvider.java | 87 ++++
.../java/org/apache/tamaya/TypeLiteral.java | 202 +++++++++
.../apache/tamaya/spi/ConfigurationContext.java | 152 +++++++
.../tamaya/spi/ConfigurationContextBuilder.java | 193 ++++++++
.../tamaya/spi/ConfigurationProviderSpi.java | 77 ++++
.../apache/tamaya/spi/PropertyConverter.java | 49 ++
.../org/apache/tamaya/spi/PropertyFilter.java | 49 ++
.../org/apache/tamaya/spi/PropertySource.java | 153 +++++++
.../tamaya/spi/PropertySourceProvider.java | 43 ++
.../spi/PropertyValueCombinationPolicy.java | 61 +++
.../org/apache/tamaya/spi/ServiceContext.java | 66 +++
.../tamaya/spi/ServiceContextManager.java | 115 +++++
.../org/apache/tamaya/ConfigExceptionTest.java | 47 ++
.../tamaya/ConfigurationProviderTest.java | 63 +++
.../org/apache/tamaya/ConfigurationTest.java | 75 ++++
.../org/apache/tamaya/TestConfiguration.java | 80 ++++
.../tamaya/TestConfigurationProvider.java | 47 ++
.../java/org/apache/tamaya/TypeLiteralTest.java | 61 +++
.../tamaya/spi/ServiceContextManagerTest.java | 131 ++++++
.../apache/tamaya/spi/ServiceContextTest.java | 91 ++++
.../apache/tamaya/spi/TestServiceContext.java | 83 ++++
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 +
.../org.apache.tamaya.spi.ServiceContext | 19 +
.../test/resources/ServiceContextWithOrdinal | 25 ++
attic/java8/core/pom.xml | 87 ++++
.../core/internal/DefaultConfiguration.java | 235 ++++++++++
.../internal/DefaultConfigurationContext.java | 240 ++++++++++
.../DefaultConfigurationContextBuilder.java | 145 ++++++
.../internal/DefaultConfigurationProvider.java | 62 +++
.../core/internal/DefaultServiceContext.java | 148 ++++++
.../core/internal/PropertyConverterManager.java | 390 ++++++++++++++++
.../converters/BigDecimalConverter.java | 60 +++
.../converters/BigIntegerConverter.java | 92 ++++
.../internal/converters/BooleanConverter.java | 65 +++
.../core/internal/converters/ByteConverter.java | 60 +++
.../core/internal/converters/CharConverter.java | 66 +++
.../internal/converters/ClassConverter.java | 58 +++
.../internal/converters/CurrencyConverter.java | 87 ++++
.../internal/converters/DoubleConverter.java | 70 +++
.../core/internal/converters/EnumConverter.java | 67 +++
.../internal/converters/FloatConverter.java | 78 ++++
.../internal/converters/IntegerConverter.java | 70 +++
.../internal/converters/LocalDateConverter.java | 36 ++
.../converters/LocalDateTimeConverter.java | 36 ++
.../internal/converters/LocalTimeConverter.java | 42 ++
.../core/internal/converters/LongConverter.java | 68 +++
.../internal/converters/NumberConverter.java | 72 +++
.../internal/converters/ShortConverter.java | 70 +++
.../core/internal/converters/URIConverter.java | 45 ++
.../core/internal/converters/URLConverter.java | 45 ++
.../internal/converters/ZoneIdConverter.java | 47 ++
.../core/propertysource/BasePropertySource.java | 55 +++
.../EnvironmentPropertySource.java | 54 +++
.../propertysource/SimplePropertySource.java | 118 +++++
.../propertysource/SystemPropertySource.java | 87 ++++
.../provider/JavaConfigurationProvider.java | 58 +++
...pache.tamaya.spi.ConfigurationContextBuilder | 19 +
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 +
.../org.apache.tamaya.spi.PropertyConverter | 37 ++
.../org.apache.tamaya.spi.PropertySource | 20 +
...org.apache.tamaya.spi.PropertySourceProvider | 19 +
.../org.apache.tamaya.spi.ServiceContext | 19 +
.../apache/tamaya/core/ConfigurationTest.java | 58 +++
.../org/apache/tamaya/core/NotMockedAnswer.java | 55 +++
.../java/org/apache/tamaya/core/internal/A.java | 29 ++
.../java/org/apache/tamaya/core/internal/B.java | 29 ++
.../java/org/apache/tamaya/core/internal/C.java | 56 +++
.../tamaya/core/internal/CTestConverter.java | 31 ++
.../core/internal/DefaultConfigurationTest.java | 204 +++++++++
.../internal/DefaultServiceContextTest.java | 128 ++++++
.../internal/PropertyConverterManagerTest.java | 162 +++++++
.../converters/BigDecimalConverterTest.java | 104 +++++
.../converters/BooleanConverterTest.java | 131 ++++++
.../internal/converters/ByteConverterTest.java | 113 +++++
.../internal/converters/CharConverterTest.java | 90 ++++
.../ConverterTestsPropertySource.java | 252 +++++++++++
.../converters/CurrencyConverterTest.java | 155 +++++++
.../converters/DoubleConverterTest.java | 176 ++++++++
.../internal/converters/EnumConverterTest.java | 53 +++
.../internal/converters/FloatConverterTest.java | 178 ++++++++
.../converters/IntegerConverterTest.java | 113 +++++
.../converters/LocalDateConverterTest.java | 41 ++
.../internal/converters/LongConverterTest.java | 113 +++++
.../converters/NumberConverterTest.java | 104 +++++
.../internal/converters/ShortConverterTest.java | 113 +++++
.../propertysource/BasePropertySourceTest.java | 104 +++++
.../EnvironmentPropertySourceTest.java | 62 +++
.../PropertiesFilePropertySourceTest.java | 64 +++
.../SystemPropertySourceTest.java | 101 +++++
.../provider/JavaConfigurationProviderTest.java | 60 +++
.../testdata/TestPropertyDefaultSource.java | 51 +++
.../core/testdata/TestPropertyFilter.java | 37 ++
.../testdata/TestPropertySourceProvider.java | 73 +++
.../testdata/TestRemovingPropertyFilter.java | 41 ++
.../META-INF/javaconfiguration.properties | 22 +
...tServiceContextTest$InvalidPriorityInterface | 19 +
...efaultServiceContextTest$MultiImplsInterface | 20 +
.../org.apache.tamaya.spi.PropertyConverter | 19 +
.../org.apache.tamaya.spi.PropertyFilter | 20 +
.../org.apache.tamaya.spi.PropertySource | 22 +
...org.apache.tamaya.spi.PropertySourceProvider | 20 +
.../core/src/test/resources/arquillian.xml | 30 ++
.../test/resources/javaconfiguration.properties | 22 +
.../test/resources/overrideOrdinal.properties | 25 ++
.../core/src/test/resources/testfile.properties | 22 +
.../core/src/test/resources/x34.properties | 19 +
attic/pom.xml | 109 +++++
core/pom.xml | 52 +++
.../core/internal/DefaultConfiguration.java | 266 +++++++++++
.../internal/DefaultConfigurationContext.java | 278 ++++++++++++
.../DefaultConfigurationContextBuilder.java | 153 +++++++
.../internal/DefaultConfigurationProvider.java | 68 +++
.../core/internal/DefaultServiceContext.java | 156 +++++++
.../core/internal/PropertyConverterManager.java | 445 +++++++++++++++++++
.../tamaya/core/internal/ReflectionUtil.java | 42 ++
.../converters/BigDecimalConverter.java | 60 +++
.../converters/BigIntegerConverter.java | 92 ++++
.../internal/converters/BooleanConverter.java | 55 +++
.../core/internal/converters/ByteConverter.java | 69 +++
.../core/internal/converters/CharConverter.java | 67 +++
.../internal/converters/ClassConverter.java | 61 +++
.../internal/converters/CurrencyConverter.java | 87 ++++
.../internal/converters/DoubleConverter.java | 79 ++++
.../core/internal/converters/EnumConverter.java | 66 +++
.../internal/converters/FloatConverter.java | 79 ++++
.../internal/converters/IntegerConverter.java | 72 +++
.../core/internal/converters/LongConverter.java | 70 +++
.../internal/converters/NumberConverter.java | 68 +++
.../internal/converters/ShortConverter.java | 70 +++
.../core/internal/converters/URIConverter.java | 45 ++
.../core/internal/converters/URLConverter.java | 45 ++
.../core/propertysource/BasePropertySource.java | 80 ++++
.../EnvironmentPropertySource.java | 64 +++
.../propertysource/SimplePropertySource.java | 128 ++++++
.../propertysource/SystemPropertySource.java | 93 ++++
.../provider/JavaConfigurationProvider.java | 58 +++
.../services/org.apache.tamaya.Configuration | 19 +
...pache.tamaya.spi.ConfigurationContextBuilder | 19 +
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 +
.../org.apache.tamaya.spi.PropertyConverter | 33 ++
.../org.apache.tamaya.spi.PropertySource | 20 +
...org.apache.tamaya.spi.PropertySourceProvider | 19 +
.../org.apache.tamaya.spi.ServiceContext | 19 +
.../apache/tamaya/core/ConfigurationTest.java | 67 +++
.../java/org/apache/tamaya/core/internal/A.java | 29 ++
.../java/org/apache/tamaya/core/internal/B.java | 29 ++
.../java/org/apache/tamaya/core/internal/C.java | 56 +++
.../tamaya/core/internal/CTestConverter.java | 31 ++
.../internal/DefaultServiceContextTest.java | 140 ++++++
.../internal/PropertyConverterManagerTest.java | 173 +++++++
.../converters/BigDecimalConverterTest.java | 103 +++++
.../converters/BooleanConverterTest.java | 108 +++++
.../internal/converters/ByteConverterTest.java | 81 ++++
.../internal/converters/CharConverterTest.java | 86 ++++
.../ConverterTestsPropertySource.java | 252 +++++++++++
.../converters/CurrencyConverterTest.java | 154 +++++++
.../converters/DoubleConverterTest.java | 175 ++++++++
.../internal/converters/EnumConverterTest.java | 54 +++
.../internal/converters/FloatConverterTest.java | 176 ++++++++
.../converters/IntegerConverterTest.java | 111 +++++
.../internal/converters/LongConverterTest.java | 111 +++++
.../converters/NumberConverterTest.java | 103 +++++
.../internal/converters/ShortConverterTest.java | 111 +++++
.../propertysource/BasePropertySourceTest.java | 104 +++++
.../EnvironmentPropertySourceTest.java | 62 +++
.../PropertiesFilePropertySourceTest.java | 58 +++
.../SystemPropertySourceTest.java | 99 +++++
.../provider/JavaConfigurationProviderTest.java | 60 +++
.../testdata/TestPropertyDefaultSource.java | 56 +++
.../core/testdata/TestPropertyFilter.java | 37 ++
.../testdata/TestPropertySourceProvider.java | 78 ++++
.../testdata/TestRemovingPropertyFilter.java | 41 ++
.../META-INF/javaconfiguration.properties | 22 +
...tServiceContextTest$InvalidPriorityInterface | 18 +
...efaultServiceContextTest$MultiImplsInterface | 20 +
.../org.apache.tamaya.spi.PropertyConverter | 19 +
.../org.apache.tamaya.spi.PropertyFilter | 20 +
.../org.apache.tamaya.spi.PropertySource | 22 +
...org.apache.tamaya.spi.PropertySourceProvider | 20 +
.../test/resources/overrideOrdinal.properties | 25 ++
core/src/test/resources/testfile.properties | 22 +
core/src/test/resources/x34.properties | 19 +
distribution/pom.xml | 37 --
...org.apache.tamaya.spi.PropertySourceProvider | 2 +-
examples/6-fileobserver-example/pom.xml | 2 +-
examples/8-remote-example/client/pom.xml | 4 +-
examples/8-remote-example/pom.xml | 4 +-
examples/8-remote-example/server/pom.xml | 4 +-
java7/api/pom.xml | 44 --
.../java/org/apache/tamaya/ConfigException.java | 44 --
.../java/org/apache/tamaya/ConfigOperator.java | 37 --
.../java/org/apache/tamaya/ConfigQuery.java | 36 --
.../java/org/apache/tamaya/Configuration.java | 102 -----
.../apache/tamaya/ConfigurationProvider.java | 93 ----
.../java/org/apache/tamaya/TypeLiteral.java | 202 ---------
.../apache/tamaya/spi/ConfigurationContext.java | 155 -------
.../tamaya/spi/ConfigurationContextBuilder.java | 166 -------
.../tamaya/spi/ConfigurationProviderSpi.java | 74 ---
.../apache/tamaya/spi/PropertyConverter.java | 41 --
.../org/apache/tamaya/spi/PropertyFilter.java | 49 --
.../org/apache/tamaya/spi/PropertySource.java | 125 ------
.../tamaya/spi/PropertySourceProvider.java | 43 --
.../spi/PropertyValueCombinationPolicy.java | 63 ---
.../org/apache/tamaya/spi/ServiceContext.java | 57 ---
.../tamaya/spi/ServiceContextManager.java | 116 -----
.../org/apache/tamaya/ConfigExceptionTest.java | 45 --
.../org/apache/tamaya/ConfigurationTest.java | 64 ---
.../org/apache/tamaya/TestConfiguration.java | 101 -----
.../tamaya/TestConfigurationProvider.java | 56 ---
.../java/org/apache/tamaya/TypeLiteralTest.java | 61 ---
.../apache/tamaya/spi/ServiceContextTest.java | 98 ----
.../apache/tamaya/spi/TestServiceContext.java | 90 ----
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 -
.../org.apache.tamaya.spi.ServiceContext | 19 -
java7/core/pom.xml | 52 ---
.../core/internal/DefaultConfiguration.java | 266 -----------
.../internal/DefaultConfigurationContext.java | 275 ------------
.../DefaultConfigurationContextBuilder.java | 153 -------
.../internal/DefaultConfigurationProvider.java | 68 ---
.../core/internal/DefaultServiceContext.java | 156 -------
.../core/internal/PropertyConverterManager.java | 414 -----------------
.../tamaya/core/internal/ReflectionUtil.java | 42 --
.../converters/BigDecimalConverter.java | 60 ---
.../converters/BigIntegerConverter.java | 92 ----
.../internal/converters/BooleanConverter.java | 56 ---
.../core/internal/converters/ByteConverter.java | 69 ---
.../core/internal/converters/CharConverter.java | 67 ---
.../internal/converters/ClassConverter.java | 61 ---
.../internal/converters/CurrencyConverter.java | 87 ----
.../internal/converters/DoubleConverter.java | 79 ----
.../core/internal/converters/EnumConverter.java | 66 ---
.../internal/converters/FloatConverter.java | 79 ----
.../internal/converters/IntegerConverter.java | 72 ---
.../core/internal/converters/LongConverter.java | 70 ---
.../internal/converters/NumberConverter.java | 68 ---
.../internal/converters/ShortConverter.java | 70 ---
.../core/internal/converters/URIConverter.java | 45 --
.../core/internal/converters/URLConverter.java | 45 --
.../core/propertysource/BasePropertySource.java | 80 ----
.../EnvironmentPropertySource.java | 64 ---
.../propertysource/SimplePropertySource.java | 128 ------
.../propertysource/SystemPropertySource.java | 93 ----
.../provider/JavaConfigurationProvider.java | 58 ---
.../services/org.apache.tamaya.Configuration | 19 -
...pache.tamaya.spi.ConfigurationContextBuilder | 19 -
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 -
.../org.apache.tamaya.spi.PropertyConverter | 33 --
.../org.apache.tamaya.spi.PropertySource | 20 -
...org.apache.tamaya.spi.PropertySourceProvider | 19 -
.../org.apache.tamaya.spi.ServiceContext | 19 -
.../apache/tamaya/core/ConfigurationTest.java | 67 ---
.../java/org/apache/tamaya/core/internal/A.java | 29 --
.../java/org/apache/tamaya/core/internal/B.java | 29 --
.../java/org/apache/tamaya/core/internal/C.java | 56 ---
.../tamaya/core/internal/CTestConverter.java | 31 --
.../internal/DefaultServiceContextTest.java | 140 ------
.../internal/PropertyConverterManagerTest.java | 173 -------
.../converters/BigDecimalConverterTest.java | 103 -----
.../converters/BooleanConverterTest.java | 108 -----
.../internal/converters/ByteConverterTest.java | 81 ----
.../internal/converters/CharConverterTest.java | 86 ----
.../ConverterTestsPropertySource.java | 252 -----------
.../converters/CurrencyConverterTest.java | 154 -------
.../converters/DoubleConverterTest.java | 175 --------
.../internal/converters/EnumConverterTest.java | 54 ---
.../internal/converters/FloatConverterTest.java | 176 --------
.../converters/IntegerConverterTest.java | 111 -----
.../internal/converters/LongConverterTest.java | 111 -----
.../converters/NumberConverterTest.java | 103 -----
.../internal/converters/ShortConverterTest.java | 111 -----
.../propertysource/BasePropertySourceTest.java | 104 -----
.../EnvironmentPropertySourceTest.java | 62 ---
.../PropertiesFilePropertySourceTest.java | 58 ---
.../SystemPropertySourceTest.java | 99 -----
.../provider/JavaConfigurationProviderTest.java | 60 ---
.../testdata/TestPropertyDefaultSource.java | 56 ---
.../core/testdata/TestPropertyFilter.java | 37 --
.../testdata/TestPropertySourceProvider.java | 78 ----
.../testdata/TestRemovingPropertyFilter.java | 41 --
.../META-INF/javaconfiguration.properties | 22 -
...tServiceContextTest$InvalidPriorityInterface | 18 -
...efaultServiceContextTest$MultiImplsInterface | 20 -
.../org.apache.tamaya.spi.PropertyConverter | 19 -
.../org.apache.tamaya.spi.PropertyFilter | 20 -
.../org.apache.tamaya.spi.PropertySource | 22 -
...org.apache.tamaya.spi.PropertySourceProvider | 20 -
.../test/resources/overrideOrdinal.properties | 25 --
.../core/src/test/resources/testfile.properties | 22 -
java7/core/src/test/resources/x34.properties | 19 -
java7/pom.xml | 101 -----
java8/api/pom.xml | 43 --
.../java/org/apache/tamaya/ConfigException.java | 46 --
.../java/org/apache/tamaya/ConfigOperator.java | 38 --
.../java/org/apache/tamaya/ConfigQuery.java | 38 --
.../java/org/apache/tamaya/Configuration.java | 232 ----------
.../apache/tamaya/ConfigurationProvider.java | 87 ----
.../java/org/apache/tamaya/TypeLiteral.java | 202 ---------
.../apache/tamaya/spi/ConfigurationContext.java | 152 -------
.../tamaya/spi/ConfigurationContextBuilder.java | 193 --------
.../tamaya/spi/ConfigurationProviderSpi.java | 77 ----
.../apache/tamaya/spi/PropertyConverter.java | 49 --
.../org/apache/tamaya/spi/PropertyFilter.java | 49 --
.../org/apache/tamaya/spi/PropertySource.java | 153 -------
.../tamaya/spi/PropertySourceProvider.java | 43 --
.../spi/PropertyValueCombinationPolicy.java | 61 ---
.../org/apache/tamaya/spi/ServiceContext.java | 66 ---
.../tamaya/spi/ServiceContextManager.java | 115 -----
.../org/apache/tamaya/ConfigExceptionTest.java | 47 --
.../tamaya/ConfigurationProviderTest.java | 63 ---
.../org/apache/tamaya/ConfigurationTest.java | 75 ----
.../org/apache/tamaya/TestConfiguration.java | 80 ----
.../tamaya/TestConfigurationProvider.java | 47 --
.../java/org/apache/tamaya/TypeLiteralTest.java | 61 ---
.../tamaya/spi/ServiceContextManagerTest.java | 131 ------
.../apache/tamaya/spi/ServiceContextTest.java | 91 ----
.../apache/tamaya/spi/TestServiceContext.java | 83 ----
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 -
.../org.apache.tamaya.spi.ServiceContext | 19 -
.../test/resources/ServiceContextWithOrdinal | 25 --
java8/core/pom.xml | 87 ----
.../core/internal/DefaultConfiguration.java | 235 ----------
.../internal/DefaultConfigurationContext.java | 240 ----------
.../DefaultConfigurationContextBuilder.java | 145 ------
.../internal/DefaultConfigurationProvider.java | 62 ---
.../core/internal/DefaultServiceContext.java | 148 ------
.../core/internal/PropertyConverterManager.java | 390 ----------------
.../converters/BigDecimalConverter.java | 60 ---
.../converters/BigIntegerConverter.java | 92 ----
.../internal/converters/BooleanConverter.java | 65 ---
.../core/internal/converters/ByteConverter.java | 60 ---
.../core/internal/converters/CharConverter.java | 66 ---
.../internal/converters/ClassConverter.java | 58 ---
.../internal/converters/CurrencyConverter.java | 87 ----
.../internal/converters/DoubleConverter.java | 70 ---
.../core/internal/converters/EnumConverter.java | 67 ---
.../internal/converters/FloatConverter.java | 78 ----
.../internal/converters/IntegerConverter.java | 70 ---
.../internal/converters/LocalDateConverter.java | 36 --
.../converters/LocalDateTimeConverter.java | 36 --
.../internal/converters/LocalTimeConverter.java | 42 --
.../core/internal/converters/LongConverter.java | 68 ---
.../internal/converters/NumberConverter.java | 72 ---
.../internal/converters/ShortConverter.java | 70 ---
.../core/internal/converters/URIConverter.java | 45 --
.../core/internal/converters/URLConverter.java | 45 --
.../internal/converters/ZoneIdConverter.java | 47 --
.../core/propertysource/BasePropertySource.java | 55 ---
.../EnvironmentPropertySource.java | 54 ---
.../propertysource/SimplePropertySource.java | 118 -----
.../propertysource/SystemPropertySource.java | 87 ----
.../provider/JavaConfigurationProvider.java | 58 ---
...pache.tamaya.spi.ConfigurationContextBuilder | 19 -
...g.apache.tamaya.spi.ConfigurationProviderSpi | 19 -
.../org.apache.tamaya.spi.PropertyConverter | 37 --
.../org.apache.tamaya.spi.PropertySource | 20 -
...org.apache.tamaya.spi.PropertySourceProvider | 19 -
.../org.apache.tamaya.spi.ServiceContext | 19 -
.../apache/tamaya/core/ConfigurationTest.java | 58 ---
.../org/apache/tamaya/core/NotMockedAnswer.java | 55 ---
.../java/org/apache/tamaya/core/internal/A.java | 29 --
.../java/org/apache/tamaya/core/internal/B.java | 29 --
.../java/org/apache/tamaya/core/internal/C.java | 56 ---
.../tamaya/core/internal/CTestConverter.java | 31 --
.../core/internal/DefaultConfigurationTest.java | 204 ---------
.../internal/DefaultServiceContextTest.java | 128 ------
.../internal/PropertyConverterManagerTest.java | 162 -------
.../converters/BigDecimalConverterTest.java | 104 -----
.../converters/BooleanConverterTest.java | 131 ------
.../internal/converters/ByteConverterTest.java | 113 -----
.../internal/converters/CharConverterTest.java | 90 ----
.../ConverterTestsPropertySource.java | 252 -----------
.../converters/CurrencyConverterTest.java | 155 -------
.../converters/DoubleConverterTest.java | 176 --------
.../internal/converters/EnumConverterTest.java | 53 ---
.../internal/converters/FloatConverterTest.java | 178 --------
.../converters/IntegerConverterTest.java | 113 -----
.../converters/LocalDateConverterTest.java | 41 --
.../internal/converters/LongConverterTest.java | 113 -----
.../converters/NumberConverterTest.java | 104 -----
.../internal/converters/ShortConverterTest.java | 113 -----
.../propertysource/BasePropertySourceTest.java | 104 -----
.../EnvironmentPropertySourceTest.java | 62 ---
.../PropertiesFilePropertySourceTest.java | 64 ---
.../SystemPropertySourceTest.java | 101 -----
.../provider/JavaConfigurationProviderTest.java | 60 ---
.../testdata/TestPropertyDefaultSource.java | 51 ---
.../core/testdata/TestPropertyFilter.java | 37 --
.../testdata/TestPropertySourceProvider.java | 73 ---
.../testdata/TestRemovingPropertyFilter.java | 41 --
.../META-INF/javaconfiguration.properties | 22 -
...tServiceContextTest$InvalidPriorityInterface | 19 -
...efaultServiceContextTest$MultiImplsInterface | 20 -
.../org.apache.tamaya.spi.PropertyConverter | 19 -
.../org.apache.tamaya.spi.PropertyFilter | 20 -
.../org.apache.tamaya.spi.PropertySource | 22 -
...org.apache.tamaya.spi.PropertySourceProvider | 20 -
java8/core/src/test/resources/arquillian.xml | 30 --
.../test/resources/javaconfiguration.properties | 22 -
.../test/resources/overrideOrdinal.properties | 25 --
.../core/src/test/resources/testfile.properties | 22 -
java8/core/src/test/resources/x34.properties | 19 -
java8/pom.xml | 109 -----
modules/classloader-support/pom.xml | 2 +-
modules/events/pom.xml | 4 +-
modules/formats/pom.xml | 4 +-
modules/functions/pom.xml | 4 +-
modules/injection/pom.xml | 4 +-
modules/integration/spring/pom.xml | 4 +-
modules/json/pom.xml | 4 +-
modules/management/pom.xml | 4 +-
modules/model/pom.xml | 4 +-
modules/optional/pom.xml | 4 +-
modules/pom.xml | 2 +-
modules/remote/pom.xml | 2 +-
modules/resolver/pom.xml | 4 +-
modules/resources/pom.xml | 2 +-
modules/server/pom.xml | 4 +-
pom.xml | 20 +-
sandbox/collections/pom.xml | 4 +-
.../tamaya/zookeeper/EmbeddedKafkaCluster.java | 138 ++++++
.../tamaya/zookeeper/EmbeddedZookeeper.java | 95 ++++
sandbox/metamodels/simple/pom.xml | 2 +-
sandbox/pom.xml | 1 +
454 files changed, 17237 insertions(+), 17094 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/pom.xml
----------------------------------------------------------------------
diff --git a/api/pom.xml b/api/pom.xml
new file mode 100644
index 0000000..369cdb6
--- /dev/null
+++ b/api/pom.xml
@@ -0,0 +1,44 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy current the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-all</artifactId>
+ <version>0.2-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tamaya-api</artifactId>
+ <name>Apache Tamaya API</name>
+
+ <description>
+ The API for accessing configuration data.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/ConfigException.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/ConfigException.java b/api/src/main/java/org/apache/tamaya/ConfigException.java
new file mode 100644
index 0000000..bac2ef4
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/ConfigException.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+/**
+ * Exception class (runtime exception) for configuration issues.
+ */
+public class ConfigException extends RuntimeException{
+
+ private static final long serialVersionUID = -5886094818057522680L;
+
+ /**
+ * Creates a new configuration exception.
+ * @param message the exception message, not null.
+ */
+ public ConfigException(String message){
+ super(message);
+ }
+
+ /**
+ * Creates a new configuration exception.
+ * @param message the exception message, not null.
+ * @param t the throwable.
+ */
+ public ConfigException(String message, Throwable t){
+ super(message, t);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/ConfigOperator.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/ConfigOperator.java b/api/src/main/java/org/apache/tamaya/ConfigOperator.java
new file mode 100644
index 0000000..2295b07
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/ConfigOperator.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya;
+
+/**
+ * Models a function that maps a given {@link org.apache.tamaya.Configuration} to another {@link org.apache.tamaya.Configuration}. This can be used
+ * to modell additional functionality and applying it to a given {@link org.apache.tamaya.Configuration} instance by calling
+ * the {@link org.apache.tamaya.Configuration#with(org.apache.tamaya.ConfigOperator)} method.
+ */
+public interface ConfigOperator {
+
+ /**
+ * Creates a new {@link org.apache.tamaya.Configuration} based on the given Configuration. Operators basically acts similar to
+ * decorators, whereas operated instances may have non compatible behaviour, e.g. by applying security constraints
+ * or view restrictions.
+ *
+ * @param config the input configuration, not null.
+ * @return the operated configuration, never null.
+ */
+ Configuration operate(Configuration config);
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/ConfigQuery.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/ConfigQuery.java b/api/src/main/java/org/apache/tamaya/ConfigQuery.java
new file mode 100644
index 0000000..9ef0179
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/ConfigQuery.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya;
+
+/**
+ * Models a function that maps a given {@link Configuration} to something else. This can be used
+ * to model additional functionality and applying it to a given {@link Configuration} instance by
+ * calling the {@link Configuration#query(ConfigQuery)} method.
+ */
+public interface ConfigQuery<T> {
+
+ /**
+ * Creates a result based on the given Configuration. Queries basically acts similar to
+ * operators, whereas they returns any kind of result.
+ *
+ * @param config the input configuration, not null.
+ * @return the query result.
+ */
+ T query(Configuration config);
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/Configuration.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/Configuration.java b/api/src/main/java/org/apache/tamaya/Configuration.java
new file mode 100644
index 0000000..47edab2
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/Configuration.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya;
+
+import java.util.Map;
+
+
+/**
+ * A configuration models a aggregated set current properties, identified by a unique key, but adds higher level access functions to
+ * a {@link org.apache.tamaya.spi.PropertySource}. Hereby in most cases a configuration is a wrapper around a composite
+ * {@link org.apache.tamaya.spi.PropertySource} instance, which may combine multiple child config in well defined tree like structure,
+ * where nodes define logically the rules current priority, filtering, combination and overriding.
+ * <br/>
+ * <h3>Implementation Requirements</h3>
+ * Implementations current this interface must be
+ * <ul>
+ * <li>Thread safe.
+ * <li>Immutable
+ * </ul>
+ * It is not recommended that implementations also are serializable, since the any configuration can be <i>freezed</i>
+ * by reading out its complete configuration map into a serializable and remotable structure. This helps significantly
+ * simplifying the development current this interface, e.g. for being backed up by systems and stores that are not part current
+ * this library at all.
+ */
+public interface Configuration {
+
+ /**
+ * Access a property.
+ *
+ * @param key the property's key, not null.
+ * @return the property's keys.
+ */
+ String get(String key);
+
+ /**
+ * Get the property keys as type T. This will implicitly require a corresponding {@link
+ * org.apache.tamaya.spi.PropertyConverter} to be available that is capable current providing type T
+ * fromMap the given String keys.
+ *
+ * @param key the property's absolute, or relative path, e.g. @code
+ * a/b/c/d.myProperty}.
+ * @param type The target type required, not null.
+ * @return the property value, never null..
+ * @throws ConfigException if the keys could not be converted to the required target type.
+ */
+ <T> T get(String key, Class<T> type);
+
+ /**
+ * Get the property keys as type T. This will implicitly require a corresponding {@link
+ * org.apache.tamaya.spi.PropertyConverter} to be available that is capable current providing type T
+ * fromMap the given String keys.
+ *
+ * @param key the property's absolute, or relative path, e.g. @code
+ * a/b/c/d.myProperty}.
+ * @param type The target type required, not null.
+ * @return the property value, never null..
+ * @throws ConfigException if the keys could not be converted to the required target type.
+ */
+ <T> T get(String key, TypeLiteral<T> type);
+
+ /**
+ * Access all current known Configuration properties as a full {@code Map<String,String>}.
+ * Be aware that entries from non scannable parts of the registered {@link org.apache.tamaya.spi.PropertySource}
+ * instances may not be contained in the result, but nevertheless be accessible calling one of the
+ * {@code get(...)} methods.
+ */
+ Map<String,String> getProperties();
+
+ /**
+ * Extension point for adjusting configuration.
+ *
+ * @param operator A configuration operator, e.g. a filter, or an adjuster
+ * combining configurations.
+ * @return the new adjusted configuration returned by the {@code operator}, never {@code null}.
+ */
+ Configuration with(ConfigOperator operator);
+
+ /**
+ * Query a configuration.
+ *
+ * @param query the query, never {@code null}.
+ * @return the result returned by the {@code query}
+ */
+ <T> T query(ConfigQuery<T> query);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java b/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
new file mode 100644
index 0000000..9e8f294
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya;
+
+import org.apache.tamaya.spi.ConfigurationContext;
+import org.apache.tamaya.spi.ConfigurationContextBuilder;
+import org.apache.tamaya.spi.ConfigurationProviderSpi;
+import org.apache.tamaya.spi.ServiceContextManager;
+
+/**
+ * Static access to the {@link Configuration} for the very application.
+ */
+public final class ConfigurationProvider {
+
+ private static final ConfigurationProviderSpi PROVIDER_SPI = loadSpi();
+
+ private static ConfigurationProviderSpi loadSpi() {
+ ConfigurationProviderSpi spi = ServiceContextManager.getServiceContext()
+ .getService(ConfigurationProviderSpi.class);
+ if(spi==null){
+ throw new IllegalStateException("ConfigurationProviderSpi not available.");
+ }
+ return spi;
+ }
+
+ private ConfigurationProvider() {
+ // just to prevent initialisation
+ }
+
+ /**
+ * Access the current configuration.
+ *
+ * @return the corresponding Configuration instance, never null.
+ */
+ public static Configuration getConfiguration() {
+ return PROVIDER_SPI.getConfiguration();
+ }
+
+ /**
+ * Get access to the current ConfigurationContext.
+ *
+ * @return the current ConfigurationContext, never null.
+ */
+ public static ConfigurationContext getConfigurationContext() {
+ return PROVIDER_SPI.getConfigurationContext();
+ }
+
+ /**
+ * This method allows to replace the current {@link org.apache.tamaya.spi.ConfigurationContext} with a new
+ * instance. This can be used to update the context with a new one, e.g. because some of the configuration
+ * data has changed and should be updated. It is the responsibility of the ConfigurationProvider to trigger
+ * corresponding update events for the current {@link org.apache.tamaya.Configuration}, so observing
+ * listeners can do whatever is appropriate to react to any given configuration changes.
+ *
+ * @param context the new ConfigurationContext to be applied.
+ * @throws java.lang.UnsupportedOperationException if the current provider is read-only and does not support
+ * applying a new ConfigurationContext.
+ */
+ public static void setConfigurationContext(ConfigurationContext context) {
+ PROVIDER_SPI.setConfigurationContext(context);
+ }
+
+ /**
+ * Create a new {@link org.apache.tamaya.spi.ConfigurationContextBuilder} instance. This method creates
+ * a new builder instance that is not related to any concrete {@link org.apache.tamaya.spi.ConfigurationContext}.
+ * You can use {@link #setConfigurationContext(org.apache.tamaya.spi.ConfigurationContext)} to change the
+ * current configuration context.
+ *
+ * @return a new, empty {@link org.apache.tamaya.spi.ConfigurationContextBuilder}, never null.
+ * @see #setConfigurationContext(org.apache.tamaya.spi.ConfigurationContext)
+ * @see org.apache.tamaya.spi.ConfigurationContext
+ */
+ public static ConfigurationContextBuilder getConfigurationContextBuilder() {
+ return PROVIDER_SPI.getConfigurationContextBuilder();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/TypeLiteral.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/TypeLiteral.java b/api/src/main/java/org/apache/tamaya/TypeLiteral.java
new file mode 100644
index 0000000..be2d008
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/TypeLiteral.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya;
+
+import java.io.Serializable;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+
+/**
+ * <p>Class for instantiation of objects that represent parameterized types
+ * with current parameters.</p>
+ * <p>
+ * <p>An object that represents a parameterized type may be obtained by
+ * subclassing <tt>TypeLiteral</tt>.</p>
+ * <p>
+ * <pre>
+ * TypeLiteral<List<Integer>> stringListType = new TypeLiteral<List<Integer>>() {};
+ * </pre>
+ *
+ * @param <T> the type, including all type parameters
+ */
+public class TypeLiteral<T> implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private static final Type[] EMPTY_TYPE_ARRAY = new Type[0];
+ /** The current defined type. */
+ private Type definedType;
+
+ /**
+ * Constructor.
+ * @param definedType the defined type.
+ */
+ protected TypeLiteral(Type definedType) {
+ this.definedType = definedType;
+ }
+
+ /**
+ * Constructor only for directly implemeting a TypeLiteral hereby dynamically implementing a generic interface.
+ */
+ protected TypeLiteral() {
+ this.definedType = getDefinedType(this.getClass());
+ }
+
+ /**
+ * Creates a new TypeLiteral based on a given type.
+ *
+ * @param type the type , not null.
+ * @param <R> the literal generic type.
+ * @return the corresponding TypeLiteral, never null.
+ */
+ public static <R> TypeLiteral<R> of(Type type) {
+ return new TypeLiteral<>(type);
+ }
+
+ /**
+ * Checks the current implemented generic interfaces and evaluates the given single type parameter.
+ *
+ * @param clazz the class to check, not null.
+ * @param interfaceType the interface type to be checked, not null.
+ * @return the generic type parameter, or null, if it cannot be evaluated.
+ */
+ public static Type[] getGenericInterfaceTypeParameters(Class<?> clazz, Class<?> interfaceType) {
+ for (Type type : clazz.getGenericInterfaces()) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ if(parameterizedType.getRawType().equals(interfaceType)){
+ return parameterizedType.getActualTypeArguments();
+ }
+ }
+ }
+ return EMPTY_TYPE_ARRAY;
+ }
+
+ /**
+ * Method that checks the class's type for a generic interface implementation type.
+ *
+ * @param type the type, not null.
+ * @return the generic type parameter of the given single type generic interfaceType, or null.
+ */
+ public static Type[] getTypeParameters(Type type) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ return parameterizedType.getActualTypeArguments();
+ }
+ return EMPTY_TYPE_ARRAY;
+ }
+
+ public final Type getType() {
+ return definedType;
+ }
+
+ /**
+ * Returns basic raw Java type.
+ *
+ * @return the actual type represented by this object
+ */
+ public final Class<T> getRawType() {
+ Class<T> rawType = null;
+
+ if (this.definedType instanceof Class) {
+ rawType = (Class<T>) this.definedType;
+ } else if (this.definedType instanceof ParameterizedType) {
+ ParameterizedType pt = (ParameterizedType) this.definedType;
+ rawType = (Class<T>) pt.getRawType();
+
+ } else if (this.definedType instanceof GenericArrayType) {
+ rawType = (Class<T>) Object[].class;
+ } else {
+ throw new RuntimeException("Illegal type for the Type Literal Class");
+ }
+
+ return rawType;
+ }
+
+
+ protected Type getDefinedType(Class<?> clazz) {
+ Type type = null;
+
+ if (clazz == null) {
+ throw new RuntimeException("Class parameter clazz can not be null");
+ }
+
+ Type superClazz = clazz.getGenericSuperclass();
+
+ if (superClazz.equals(Object.class)) {
+ throw new RuntimeException("Super class must be parametrized type");
+ } else if (superClazz instanceof ParameterizedType) {
+ ParameterizedType pt = (ParameterizedType) superClazz;
+ Type[] actualArgs = pt.getActualTypeArguments();
+
+ if (actualArgs.length == 1) {
+ type = actualArgs[0];
+
+ } else {
+ throw new RuntimeException("More than one parametric type");
+ }
+
+ } else {
+ type = getDefinedType((Class<?>) superClazz);
+ }
+
+ return type;
+ }
+
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((definedType == null) ? 0 : definedType.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TypeLiteral<?> other = (TypeLiteral<?>) obj;
+ if (definedType == null) {
+ if (other.definedType != null) {
+ return false;
+ }
+ } else if (!definedType.equals(other.definedType)) {
+ return false;
+ }
+ return true;
+ }
+
+
+ @Override
+ public String toString() {
+ return "TypeLiteral{" +
+ "type=" + definedType +
+ '}';
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/ConfigurationContext.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/ConfigurationContext.java b/api/src/main/java/org/apache/tamaya/spi/ConfigurationContext.java
new file mode 100644
index 0000000..f0b7265
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/ConfigurationContext.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+
+import org.apache.tamaya.TypeLiteral;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Central SPI for programmatically dealing with the setup of the configuration system.
+ * This includes adding and enlisting {@link org.apache.tamaya.spi.PropertySource}s,
+ * managing {@link PropertyConverter}s, ConfigFilters, etc.
+ */
+public interface ConfigurationContext {
+
+ /**
+ * This method can be used for programmatically adding {@link PropertySource}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param propertySourcesToAdd the PropertySources to add
+ */
+ void addPropertySources(PropertySource... propertySourcesToAdd);
+
+ /**
+ * This method returns the current list of registered PropertySources ordered via their ordinal.
+ * PropertySources with a lower ordinal come last. The PropertySource with the
+ * highest ordinal comes first.
+ * If two PropertySources have the same ordinal number they will get sorted
+ * using their class name just to ensure the user at least gets the same ordering
+ * after a JVM restart, hereby names before are added last.
+ * PropertySources are loaded when this method is called the first time, which basically is
+ * when the first time configuration is accessed.
+ *
+ * @return a sorted list of registered PropertySources. The returned list need not be modifiable
+ */
+ List<PropertySource> getPropertySources();
+
+
+ /**
+ * This method can be used for programmatically adding {@link PropertyConverter}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param typeToConvert the type which the converter is for
+ * @param propertyConverter the PropertyConverters to add for this type
+ */
+ <T> void addPropertyConverter(TypeLiteral<T> typeToConvert, PropertyConverter<T> propertyConverter);
+
+ /**
+ * <p>
+ * This method returns the Map of registered PropertyConverters
+ * per type.
+ * The List for each type is ordered via their {@link javax.annotation.Priority} and
+ * cladd name. Refer also to {@link #getPropertyConverters()}.
+ * </p>
+ * <p>
+ * A simplified scenario could be like:
+ * <pre>
+ * {
+ * Date.class -> {StandardDateConverter, TimezoneDateConverter, MyCustomDateConverter }
+ * Boolean.class -> {StandardBooleanConverter, FrenchBooleanConverter}
+ * Integer.class -> {DynamicDefaultConverter}
+ * }
+ * </pre>
+ * </p>
+ *
+ * @return map with sorted list of registered PropertySources per type.
+ */
+ Map<TypeLiteral<?>, List<PropertyConverter<?>>> getPropertyConverters();
+
+ /**
+ * <p>
+ * This method returns the registered PropertyConverters for a given type.
+ * The List for each type is ordered via their {@link javax.annotation.Priority}.
+ * </p>
+ *
+ * <p>
+ * PropertyConverters with a higher Priority come first. The PropertyConverter with the
+ * lowest Priority comes last.
+ * If two PropertyConverter have the same ordinal number they will get sorted
+ * using their class name just to ensure the user at least gets the same ordering
+ * after a JVM restart.
+ * </p>
+ *
+ * <p>
+ * Additionally if a PropertyProvider is accessed, which is not registered the implementation
+ * should try to figure out, if there could be a default implementation as follows:
+ * <ol>
+ * <le>Look for static factory methods: {@code of(String), valueOf(String), getInstance(String),
+ * instanceOf(String), fomr(String)}</le>
+ * <le>Look for a matching constructor: {@code T(String)}.</le>
+ * </ol>
+ * If a correspoding factory method or constructor could be found, a corresponding
+ * PropertyConverter should be created and registered automatically for the given
+ * type.
+ * </p>
+ *
+ * <p>
+ * The scenario could be like:
+ * <pre>
+ * {
+ * Date.class -> {MyCustomDateConverter,StandardDateConverter, TimezoneDateConverter}
+ * Boolean.class -> {StandardBooleanConverter, FrenchBooleanConverter}
+ * Integer.class -> {DynamicDefaultConverter}
+ * }
+ * </pre>
+ * </p>
+ *
+ * <p>
+ * The converters returned for a type should be used as a chain, whereas the result of the
+ * first converter that is able to convert the configured value, is taken as the chain's result.
+ * No more converters are called after a converter has successfully converted the input into
+ * the required target type.
+ * </p>
+ *
+ * @return a sorted list of registered PropertySources per type.
+ */
+ <T> List<PropertyConverter<T>> getPropertyConverters(TypeLiteral<T> type);
+
+ /**
+ * Access the current PropertyFilter instances.
+ * @return the list of registered PropertyFilters, never null.
+ */
+ List<PropertyFilter> getPropertyFilters();
+
+ /**
+ * Access the {@link org.apache.tamaya.spi.PropertyValueCombinationPolicy} used to evaluate the final
+ * property values.
+ * @return the {@link org.apache.tamaya.spi.PropertyValueCombinationPolicy} used, never null.
+ */
+ PropertyValueCombinationPolicy getPropertyValueCombinationPolicy();
+
+ /**
+ * Creates a {@link ConfigurationContextBuilder} preinitialized with the data from this instance.
+ * @return a new builder instance, never null.
+ */
+ ConfigurationContextBuilder toBuilder();
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/ConfigurationContextBuilder.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/ConfigurationContextBuilder.java b/api/src/main/java/org/apache/tamaya/spi/ConfigurationContextBuilder.java
new file mode 100644
index 0000000..d0c39d6
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/ConfigurationContextBuilder.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+import org.apache.tamaya.TypeLiteral;
+
+import java.util.Collection;
+
+/**
+ * A builder for creating new or adapting instances of {@link ConfigurationContext}.
+ * Builders can be obtained in exactly two ways:
+ * <ol>
+ * <li>By accessing a preinitialized builder from an existing {@link ConfigurationContext},
+ * by calling {@link org.apache.tamaya.spi.ConfigurationContext#toBuilder()}.</li>
+ * <li>By accessing an empty builder instance from
+ * {@link org.apache.tamaya.ConfigurationProvider#getConfigurationContextBuilder()}.</li>
+ * </ol>
+ * After all changes are applied to a builder a new {@link ConfigurationContext} instance can
+ * be created and can be applied by calling
+ * {@link org.apache.tamaya.ConfigurationProvider#setConfigurationContext(org.apache.tamaya.spi.ConfigurationContext)}. Since this method can
+ * throw an UnsupportedOperationException, you should check before if changing the current ConfigurationContext
+ * programmatically is supported by calling
+ * {@link org.apache.tamaya.ConfigurationProvider#isConfigurationContextSettable()}.
+ */
+public interface ConfigurationContextBuilder {
+
+ /**
+ * Init this builder instance with the given {@link ConfigurationContext} instance. This
+ * method will replace any existing data in the current builder with the data contained in the given
+ * {@link ConfigurationContext}.
+ *
+ * @param context the {@link ConfigurationContext} instance to be used, not null.
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder setContext(ConfigurationContext context);
+
+ /**
+ * This method can be used for programmatically adding {@link PropertySource}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param propertySourcesToAdd the PropertySources to add
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder addPropertySources(PropertySource... propertySourcesToAdd);
+
+ /**
+ * This method can be used for programmatically adding {@link PropertySource}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param propertySourcesToAdd the PropertySources to add
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder addPropertySources(Collection<PropertySource> propertySourcesToAdd);
+
+ /**
+ * This method can be used for programmatically adding {@link PropertySource}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param propertySourcesNames the PropertySource names of the sources to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertySources(String... propertySourcesNames);
+
+ /**
+ * This method can be used for programmatically adding {@link PropertySource}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param propertySourcesNames the PropertySource names of the sources to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertySources(Collection<String> propertySourcesNames);
+
+ /**
+ * Adds the given PropertyFilter instances.
+ *
+ * @param filters the filters to add
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder addPropertyFilters(PropertyFilter... filters);
+
+ /**
+ * Adds the given PropertyFilter instances.
+ *
+ * @param filters the filters to add
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder addPropertyFilters(Collection<PropertyFilter> filters);
+
+ /**
+ * Removes the given PropertyFilter instances.
+ *
+ * @param filters the filters to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertyFilters(PropertyFilter... filters);
+
+ /**
+ * Removes the given PropertyFilter instances.
+ *
+ * @param filters the filters to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertyFilters(Collection<PropertyFilter> filters);
+
+ /**
+ * This method can be used for programmatically adding {@link PropertyConverter}s.
+ * It is not needed for normal 'usage' by end users, but only for Extension Developers!
+ *
+ * @param typeToConvert the type which the converter is for
+ * @param propertyConverter the PropertyConverters to add for this type
+ * @return this builder, for chaining, never null.
+ */
+ <T> ConfigurationContextBuilder addPropertyConverter(TypeLiteral<T> typeToConvert,
+ PropertyConverter<T> propertyConverter);
+
+ /**
+ * Removes the given PropertyConverter instances.
+ *
+ * @param typeToConvert the type which the converter is for
+ * @param converters the converters to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertyConverters(TypeLiteral<?> typeToConvert,
+ PropertyConverter<?>... converters);
+
+ /**
+ * Removes the given PropertyConverter instances.
+ *
+ * @param typeToConvert the type which the converter is for
+ * @param converters the converters to remove
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder removePropertyConverters(TypeLiteral<?> typeToConvert,
+ Collection<PropertyConverter<?>> converters);
+
+ /**
+ * Sets the {@link PropertyValueCombinationPolicy} used to evaluate the final
+ * property values.
+ *
+ * @param policy the {@link PropertyValueCombinationPolicy} used, not null
+ * @return this builder, for chaining, never null.
+ */
+ ConfigurationContextBuilder setPropertyValueCombinationPolicy(PropertyValueCombinationPolicy policy);
+
+ /**
+ * Builds a {@link ConfigurationContext} based on the data set.
+ */
+ ConfigurationContext build();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/ConfigurationProviderSpi.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/ConfigurationProviderSpi.java b/api/src/main/java/org/apache/tamaya/spi/ConfigurationProviderSpi.java
new file mode 100644
index 0000000..bb87372
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/ConfigurationProviderSpi.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+import org.apache.tamaya.Configuration;
+
+/**
+ * SPI that must be implemented to provide the component that manages all {@link org.apache.tamaya.Configuration}
+ * instances in a system. In SE this may be a true singleton containing exact one {@link org.apache.tamaya.Configuration}
+ * instance, whereas in Java EE and other more complex environments instances may be returned depending the current
+ * runtime context.
+ */
+public interface ConfigurationProviderSpi {
+
+ /**
+ * Access the current {@link org.apache.tamaya.Configuration}.
+ *
+ * @return the current {@link org.apache.tamaya.Configuration} instance, never null.
+ */
+ Configuration getConfiguration();
+
+ /**
+ * Get access to the current {@link ConfigurationContext}.
+ *
+ * @return the current {@link ConfigurationContext}, never null.
+ */
+ ConfigurationContext getConfigurationContext();
+
+ /**
+ * This method allows to replace the current {@link org.apache.tamaya.spi.ConfigurationContext} with a new
+ * instance. This can be used to update the context with a new one, e.g. because some of the configuration
+ * data has changed and must be updated. It is the responsibility of the ConfigurationProvider to trigger
+ * corresponding update event for the current {@link org.apache.tamaya.spi.ConfigurationContext} or
+ * {@link org.apache.tamaya.Configuration}.
+ *
+ * @param context the new ConfigurationContext to be applied.
+ * @throws java.lang.UnsupportedOperationException if the current provider is read-only.
+ */
+ void setConfigurationContext(ConfigurationContext context);
+
+ /**
+ * Method that allows to determine if a new {@link org.apache.tamaya.spi.ConfigurationContext} can be applied
+ * programmatically.
+ *
+ * @return true, if {@link #setConfigurationContext(org.apache.tamaya.spi.ConfigurationContext)} is supported
+ * by the current implementation.
+ * @see #setConfigurationContext(org.apache.tamaya.spi.ConfigurationContext)
+ */
+ boolean isConfigurationContextSettable();
+
+ /**
+ * Creates a new {@link org.apache.tamaya.spi.ConfigurationContextBuilder} instance.
+ *
+ * @return a new {@link org.apache.tamaya.spi.ConfigurationContextBuilder}, never null.
+ */
+ ConfigurationContextBuilder getConfigurationContextBuilder();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java b/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
new file mode 100644
index 0000000..167e0a8
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.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.spi;
+
+
+/**
+ * Interface for an property that converts a configured String into something else.
+ * This is used for implementing type conversion from a property (String) to a certain target
+ * type. Hereby the target type can be multivalued (eg collections) or complex if needed.
+ */
+public interface PropertyConverter<T>{
+
+ /**
+ * Convert the given configuration keys from it' String representation into the required target type.
+ * @param value the configuration keys
+ * @return converted keys
+ */
+ T convert(String value);
+
+ //X TODO probably add some diagnostic info which explains what kind of
+ //X format(s) is supported.
+ //X This could be useful if e.g. no converter in the chain felt responsible
+ //X because a wrongly formatted configuration string had been used.
+ //X This could probably also be handled via an additional Annotation on the converter.
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java b/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
new file mode 100644
index 0000000..55f4295
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+
+/**
+ * <p>Interface for filtering the current map of properties during the evaluation of the chain of PropertySources.
+ * Filters can be registered using the {@link org.apache.tamaya.spi.ServiceContext}. The ordinal
+ * hereby is defined by the corresponding {@code @Priority} annotation.</p>
+ * <p>Filters </p>
+ */
+public interface PropertyFilter {
+
+ /**
+ * <p>Maps the current {@code valueToBeFiltered} value to a new value. The resulting value will be used as the result
+ * passed to the user.</p>
+ * <p>If a filter is currently not available, it should just pass the input map to the method's
+ * output.</p>
+ * <p>Returning {@code null} will remove the entry.</p>
+ * <h3>Implementation specification</h3>
+ * Implementations of this class must be
+ * <ul>
+ * <li>reentrant</li>
+ * <li>thread-safe</li>
+ * </ul>
+ *
+ * @param key the key accessed, not null.
+ * @param valueToBeFiltered the value to be filtered, not null.
+ * @return the filtered value, or {@code null} if the value should be removed alltogether.
+ */
+ String filterProperty(String key, String valueToBeFiltered);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/PropertySource.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/PropertySource.java b/api/src/main/java/org/apache/tamaya/spi/PropertySource.java
new file mode 100644
index 0000000..4457919
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/PropertySource.java
@@ -0,0 +1,125 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.tamaya.spi;
+
+
+import java.util.Map;
+
+
+/**
+ * This interface models a provider that serves configuration properties. The contained
+ * properties may be read fromMap single or several sources (composite).<br/>
+ * PropertySources are the building blocks of the final configuration.
+ * <p/>
+ * <h3>Implementation Requirements</h3>
+ * <p></p>Implementations current this interface must be
+ * <ul>
+ * <li>Thread safe.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * <p>A PropertySourceProvider will get picked up via the
+ * {@link java.util.ServiceLoader} mechanism and can be registered via
+ * META-INF/services/org.apache.tamaya.spi.PropertySource
+ * </p>
+ * <p>
+ * If you like to register multiple PropertySources at the same time
+ * you can use the {@link org.apache.tamaya.spi.PropertySourceProvider}
+ * interface.
+ * </p>
+ */
+public interface PropertySource {
+
+ /**
+ * property name to override default tamaya ordinals
+ */
+ static final String TAMAYA_ORDINAL = "tamaya.ordinal";
+
+
+ /**
+ * Lookup order:
+ * TODO rethink whole default PropertySources and ordering:
+ * TODO introduce default values or constants for ordinals
+ * <ol>
+ * <li>System properties (ordinal 400)</li>
+ * <li>Environment properties (ordinal 300)</li>
+ * <li>JNDI values (ordinal 200)</li>
+ * <li>Properties file values (/META-INF/applicationConfiguration.properties) (ordinal 100)</li>
+ * </ol>
+ * <p/>
+ * <p><b>Important Hints for custom implementations</b>:</p>
+ * <p>
+ * If a custom implementation should be invoked <b>before</b> the default implementations, use a value > 400
+ * </p>
+ * <p>
+ * If a custom implementation should be invoked <b>after</b> the default implementations, use a value < 100
+ * </p>
+ * <p/>
+ * <p>Reordering of the default order of the config-sources:</p>
+ * <p>Example: If the properties file/s should be used <b>before</b> the other implementations,
+ * you have to configure an ordinal > 400. That means, you have to add e.g. deltaspike_ordinal=401 to
+ * /META-INF/apache-deltaspike.properties . Hint: In case of property files every file is handled as independent
+ * config-source, but all of them have ordinal 400 by default (and can be reordered in a fine-grained manner.</p>
+ *
+ * @return the 'importance' aka ordinal of the configured values. The higher, the more important.
+ * //X TODO think about making this a default method which returns default priority
+ */
+ int getOrdinal();
+
+
+ /**
+ * Get the name of the property source. The name should be unique for the type of source, whereas the id is used
+ * to ensure unique identity, either locally or remotely.
+ * @return the configuration's name, never null.
+ */
+ String getName();
+
+ /**
+ * Access a property.
+ *
+ * //X TODO discuss if the key can be null
+ * @param key the property's key, not null.
+ * @return the property's keys.
+ */
+ String get(String key);
+
+ /**
+ * Access the current properties as Map. The resulting Map may not return all items accessible, e.g.
+ * when the underlying storage does not support iteration of its entries.
+ *
+ * @return the a corresponding map, never null.
+ * //X TODO or should we just do getPropertyKeys()? Think about security (key) vs easier merging (full map)?
+ */
+ Map<String,String> getProperties();
+
+ /**
+ * Determines if this config source could be scanned for its list of properties.
+ *
+ * <p>
+ * PropertySources which are not scannable might not be able to find all the
+ * configured values to provide via {@link #getProperties()}. This can e.g. happen
+ * if the underlying storage doesn't support listing.
+ * </p>
+ *
+ * @return {@code true} if this PropertySource could be scanned for its list of properties,
+ * {@code false} if it should not be scanned.
+ */
+ boolean isScannable();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java b/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
new file mode 100644
index 0000000..42e3b4d
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+import java.util.Collection;
+
+/**
+ * <p>Implement this interfaces to provide a PropertySource provider which
+ * is able to register multiple PropertySources. This is e.g. needed if
+ * there are multiple property files of a given config file name.</p>
+ *
+ * <p>If a PropertySource like JNDI only exists once, then there is no need
+ * to implement it via the PropertySourceProvider but should directly
+ * expose a {@link PropertySource}.</p>
+ *
+ * <p>A PropertySourceProvider will get picked up via the
+ * {@link java.util.ServiceLoader} mechanism and must get registered via
+ * META-INF/services/org.apache.tamaya.spi.PropertySourceProvider</p>
+ */
+public interface PropertySourceProvider {
+
+ /**
+ * @return For each e.g. property file, we return a single PropertySource
+ * or an empty list if no PropertySource exists.
+ */
+ Collection<PropertySource> getPropertySources();
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/PropertyValueCombinationPolicy.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/PropertyValueCombinationPolicy.java b/api/src/main/java/org/apache/tamaya/spi/PropertyValueCombinationPolicy.java
new file mode 100644
index 0000000..dbda457
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/PropertyValueCombinationPolicy.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+/**
+ * Policy that determines how the final value of a configuration entry is evaluated. An instances of this
+ * interface can be registered to get control how multiple PropertySources are combined. This is useful in cases
+ * where the default overriding policy as implemented in {@link #DEFAULT_OVERRIDING_COLLECTOR} is not matching
+ * the need of the current application, e.g. then entries containing multiple values should be combined to new
+ * values instead of overridden.
+ */
+public interface PropertyValueCombinationPolicy {
+
+ /**
+ * Default overriding collector, where each existing entry ({@code current} is overridden by a subsequent non-null
+ * entry evaluated by {@code propertySource.get(key)}.
+ */
+ public static final PropertyValueCombinationPolicy DEFAULT_OVERRIDING_COLLECTOR = new PropertyValueCombinationPolicy(){
+
+ @Override
+ public String collect(String currentValue, String key, PropertySource propertySource) {
+ String value = propertySource.get(key);
+ return value!=null?value:currentValue;
+ }
+
+ };
+
+ /**
+ * Method that is called for each value evaluated by a PropertySource for the given key. This method is called
+ * either when a single key is accessed, e.g. by calling {@code org.apache.tamaya.Configuration.getXXX}, but also
+ * when the full configuration property map is accessed by calling
+ * {@link org.apache.tamaya.Configuration#getProperties()}.
+ *
+ * @param currentValue the current value, including null.
+ * The collector should either combine the existing value with value from {@code currentValue}
+ * or replace the value in {@code currentValue} with {@code valueRead}, hereby returning the
+ * result to be used as new {@code currentValue}.
+ * @param key The current key to be evaluated.
+ * @param propertySource The PropertySource that may return an value for the given key. The PropertySource given
+ * may be evaluated for additional meta-data, how the given values are to be combined.
+ * Note that the value returned by a PropertySource can be null. In that case
+ * {@code currentValue} should be returned in almost all cases.
+ * @return the value to be used for future evaluation.
+ */
+ String collect(String currentValue, String key, PropertySource propertySource);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b6dc2eed/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java b/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
new file mode 100644
index 0000000..cdd481e
--- /dev/null
+++ b/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.spi;
+
+import java.util.List;
+
+
+/**
+ * This class models the component that is managing the lifecycle current the
+ * services used by the Configuration API.
+ */
+public interface ServiceContext {
+
+ /**
+ * @return ordinal of the ServiceContext. The one with the highest ordinal will be taken.
+ */
+ int ordinal();
+
+ /**
+ * Access a service singleton via its type.
+ * If multiple implementations for the very serviceType exist then
+ * the one with the highest {@link javax.annotation.Priority} will be used.
+ *
+ * @param serviceType the service type.
+ * @return The instance to be used, or {@code null}
+ * @throws org.apache.tamaya.ConfigException if there are multiple service implementations with the maximum priority.
+ */
+ <T> T getService(Class<T> serviceType);
+
+ /**
+ * Access a list current services, given its type. The bootstrap mechanism should
+ * order the instance for precedence, hereby the most significant should be
+ * first in order.
+ *
+ * @param serviceType
+ * the service type.
+ * @return The instance to be used, never {@code null}
+ */
+ <T> List<T> getServices(Class<T> serviceType);
+
+}