io.smallrye.config
smallrye-config-common
diff --git a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java
similarity index 96%
rename from api/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java
rename to implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java
index bab66c0d4..d791c8032 100644
--- a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptor.java
@@ -4,8 +4,6 @@
import java.util.Collections;
import java.util.Iterator;
-import io.smallrye.common.annotation.Experimental;
-
/**
* The ConfigSourceInterceptor allows to intercept the resolution of a configuration name before the
* configuration value is resolved by the Config and before any conversion taking place. It can also intercept
@@ -28,7 +26,6 @@
* of {@code io.smallrye.config.Priorities#APPLICATION} is assumed. If multiple interceptors are registered with the
* same priority, then their execution order may be non deterministic.
*/
-@Experimental("Interceptor API to intercept resolution of a configuration name")
public interface ConfigSourceInterceptor extends Serializable {
/**
* Intercept the resolution of a configuration name and either return the corresponding {@link ConfigValue} or a
diff --git a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java
similarity index 89%
rename from api/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java
rename to implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java
index 88b2bcd65..4f443e85a 100644
--- a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorContext.java
@@ -3,13 +3,10 @@
import java.io.Serializable;
import java.util.Iterator;
-import io.smallrye.common.annotation.Experimental;
-
/**
* Exposes contextual information about the intercepted invocation of {@link ConfigSourceInterceptor}. This allows
* implementers to control the behavior of the invocation chain.
*/
-@Experimental("Interceptor API to intercept resolution of a configuration name")
public interface ConfigSourceInterceptorContext extends Serializable {
/**
* Proceeds to the next interceptor in the chain.
diff --git a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java
similarity index 87%
rename from api/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java
rename to implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java
index 061309766..02fda8355 100644
--- a/api/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigSourceInterceptorFactory.java
@@ -2,8 +2,6 @@
import java.util.OptionalInt;
-import io.smallrye.common.annotation.Experimental;
-
/**
* This ConfigSourceInterceptorFactory allows to initialize a {@link ConfigSourceInterceptor}, with access to the
* current {@link ConfigSourceInterceptorContext}.
@@ -14,13 +12,12 @@
* initialized.
*
*
- * Instances of this interface will be discovered by {@code SmallRyeConfigBuilder#addDiscoveredInterceptors()} via the
+ * Instances of this interface will be {@link SmallRyeConfigBuilder#addDiscoveredInterceptors()} via the
* {@link java.util.ServiceLoader} mechanism and can be registered by providing a
* {@code META-INF/services/io.smallrye.config.ConfigSourceInterceptorFactory}
* {@linkplain ClassLoader#getResource(String) resource} which contains the fully qualified class name of the
* custom {@code ConfigSourceProvider} implementation.
*/
-@Experimental("Interceptor API to intercept resolution of a configuration name")
public interface ConfigSourceInterceptorFactory {
/**
* The default priority value, {@link Priorities#APPLICATION}.
diff --git a/api/src/main/java/io/smallrye/config/ConfigValue.java b/implementation/src/main/java/io/smallrye/config/ConfigValue.java
similarity index 96%
rename from api/src/main/java/io/smallrye/config/ConfigValue.java
rename to implementation/src/main/java/io/smallrye/config/ConfigValue.java
index 9964d93a4..138719f26 100644
--- a/api/src/main/java/io/smallrye/config/ConfigValue.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigValue.java
@@ -2,8 +2,6 @@
import java.util.Objects;
-import io.smallrye.common.annotation.Experimental;
-
/**
* The ConfigValue is a metadata object that holds additional information after the lookup of a configuration.
*
@@ -16,7 +14,6 @@
* This is used together with {@link ConfigValueConfigSource} and {@link ConfigSourceInterceptor} to expose the
* Configuration lookup metadata.
*/
-@Experimental("Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup")
public class ConfigValue {
private final String name;
private final String value;
diff --git a/api/src/main/java/io/smallrye/config/ConfigValueConfigSource.java b/implementation/src/main/java/io/smallrye/config/ConfigValueConfigSource.java
similarity index 94%
rename from api/src/main/java/io/smallrye/config/ConfigValueConfigSource.java
rename to implementation/src/main/java/io/smallrye/config/ConfigValueConfigSource.java
index 9672ebc5e..88bf17a57 100644
--- a/api/src/main/java/io/smallrye/config/ConfigValueConfigSource.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigValueConfigSource.java
@@ -5,8 +5,6 @@
import org.eclipse.microprofile.config.spi.ConfigSource;
-import io.smallrye.common.annotation.Experimental;
-
/**
* Extends the original {@link ConfigSource} to expose methods that return a {@link ConfigValue}. The
* {@link ConfigValue} allows to retrieve additional metadata associated with the configuration resolution.
@@ -19,7 +17,6 @@
*
* Ideally, this should move the the MicroProfile Config API, once the concept is well-proven.
*/
-@Experimental("Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup")
public interface ConfigValueConfigSource extends ConfigSource {
/**
* Return the {@link ConfigValue} for the specified property in this configuration source.
diff --git a/api/src/main/java/io/smallrye/config/ConfigValueMapView.java b/implementation/src/main/java/io/smallrye/config/ConfigValueMapView.java
similarity index 95%
rename from api/src/main/java/io/smallrye/config/ConfigValueMapView.java
rename to implementation/src/main/java/io/smallrye/config/ConfigValueMapView.java
index c4ae9f637..9a4cd1696 100644
--- a/api/src/main/java/io/smallrye/config/ConfigValueMapView.java
+++ b/implementation/src/main/java/io/smallrye/config/ConfigValueMapView.java
@@ -9,15 +9,12 @@
import java.util.Map;
import java.util.Set;
-import io.smallrye.common.annotation.Experimental;
-
/**
* The ConfigValueMapView is view over a Map of String configs names and ConfigValue value.
*
*
* Use this to wrap the ConfigValue map and expose it where a Map of String name and String value is required.
*/
-@Experimental("Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup")
public final class ConfigValueMapView extends AbstractMap {
private final Map delegate;
diff --git a/api/src/main/java/io/smallrye/config/Priorities.java b/implementation/src/main/java/io/smallrye/config/Priorities.java
similarity index 84%
rename from api/src/main/java/io/smallrye/config/Priorities.java
rename to implementation/src/main/java/io/smallrye/config/Priorities.java
index bf095c53a..fbb1dfff1 100644
--- a/api/src/main/java/io/smallrye/config/Priorities.java
+++ b/implementation/src/main/java/io/smallrye/config/Priorities.java
@@ -1,12 +1,9 @@
package io.smallrye.config;
-import io.smallrye.common.annotation.Experimental;
-
/**
* A collection of built-in priority constants for {@link ConfigSourceInterceptor} that are supposed to be
* ordered based on their {@code javax.annotation.Priority} class-level annotation.
*/
-@Experimental("Interceptor API to intercept resolution of a configuration name")
public final class Priorities {
/**
* Range for early interceptors defined by Platform specifications.
diff --git a/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java b/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java
index 5f6683e15..72e254359 100644
--- a/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java
+++ b/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java
@@ -314,8 +314,7 @@ private static class ConfigSources implements Serializable {
ConfigSources(final List sources, final ConfigSources configSources) {
sources.sort(CONFIG_SOURCE_COMPARATOR);
- SmallRyeConfigSourceInterceptorContext current = new SmallRyeConfigSourceInterceptorContext(
- EMPTY, null);
+ SmallRyeConfigSourceInterceptorContext current = new SmallRyeConfigSourceInterceptorContext(EMPTY, null);
for (int i = sources.size() - 1; i >= 0; i--) {
current = new SmallRyeConfigSourceInterceptorContext(configSourceInterceptor(sources.get(i)), current);
diff --git a/implementation/src/test/java/io/smallrye/config/ConfigValueMapStringViewTest.java b/implementation/src/test/java/io/smallrye/config/ConfigValueMapStringViewTest.java
index a4693e2dc..a30d6d638 100644
--- a/implementation/src/test/java/io/smallrye/config/ConfigValueMapStringViewTest.java
+++ b/implementation/src/test/java/io/smallrye/config/ConfigValueMapStringViewTest.java
@@ -21,7 +21,7 @@ public void size() {
@Test
public void isEmpty() {
- assertTrue(new ConfigValueMapStringView(new HashMap<>(), "test", 1).isEmpty());
+ assertTrue(new ConfigValueMapView(new HashMap<>()).isEmpty());
}
@Test
diff --git a/api/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java b/implementation/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java
similarity index 81%
rename from api/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java
rename to implementation/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java
index e16d9d842..4e678052a 100644
--- a/api/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java
+++ b/implementation/src/test/java/io/smallrye/config/ConfigValueMapViewTest.java
@@ -5,6 +5,7 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
+import java.io.IOException;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.HashMap;
@@ -98,6 +99,20 @@ public void values() {
assertThrows(UnsupportedOperationException.class, () -> values.remove("1234"));
}
+ @Test
+ public void configSourceMap() throws IOException {
+ final ConfigValuePropertiesConfigSource configSource = new ConfigValuePropertiesConfigSource(
+ ConfigValueMapViewTest.class.getResource("/config-values.properties"));
+ final Map properties = configSource.getProperties();
+
+ assertEquals("abc", properties.get("my.prop"));
+ assertEquals("abc", properties.get("my.prop"));
+ assertThrows(UnsupportedOperationException.class, () -> properties.remove("x"));
+ assertThrows(UnsupportedOperationException.class, () -> properties.put("x", "x"));
+ assertThrows(UnsupportedOperationException.class, () -> properties.putAll(new HashMap<>()));
+ assertThrows(UnsupportedOperationException.class, properties::clear);
+ }
+
private ConfigValueMapView sampleMap() {
final Map configValueMap = new HashMap<>();
configValueMap.put("my.prop", ConfigValue.builder().withName("my.prop").withValue("1234").build());
diff --git a/implementation/src/test/java/io/smallrye/config/ConfigValuePropertiesConfigSourceTest.java b/implementation/src/test/java/io/smallrye/config/ConfigValuePropertiesConfigSourceTest.java
index 98964336e..7ca8120a1 100644
--- a/implementation/src/test/java/io/smallrye/config/ConfigValuePropertiesConfigSourceTest.java
+++ b/implementation/src/test/java/io/smallrye/config/ConfigValuePropertiesConfigSourceTest.java
@@ -1,12 +1,5 @@
package io.smallrye.config;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
import org.eclipse.microprofile.config.Config;
import org.junit.Assert;
import org.junit.Test;
@@ -20,20 +13,6 @@ public void interceptor() throws Exception {
Assert.assertEquals("20", config.getValue("my.prop.20", String.class));
}
- @Test
- public void configSourceMap() throws IOException {
- final ConfigValuePropertiesConfigSource configSource = new ConfigValuePropertiesConfigSource(
- ConfigValuePropertiesConfigSourceTest.class.getResource("/config-values.properties"));
- final Map properties = configSource.getProperties();
-
- assertEquals("abc", properties.get("my.prop"));
- assertEquals("abc", properties.get("my.prop"));
- assertThrows(UnsupportedOperationException.class, () -> properties.remove("x"));
- assertThrows(UnsupportedOperationException.class, () -> properties.put("x", "x"));
- assertThrows(UnsupportedOperationException.class, () -> properties.putAll(new HashMap<>()));
- assertThrows(UnsupportedOperationException.class, properties::clear);
- }
-
private static Config buildConfig() throws Exception {
return new SmallRyeConfigBuilder()
.addDefaultSources()
diff --git a/pom.xml b/pom.xml
index f0b0bb80f..a31cf59e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,6 @@
common
- api
implementation
sources/hocon
sources/file-system
@@ -116,11 +115,6 @@
-