Skip to content

Commit

Permalink
removed qualifier definition and updated wording after discussion wit…
Browse files Browse the repository at this point in the history
…h EG;
  • Loading branch information
sdaschner committed Sep 11, 2018
1 parent 0383f11 commit 8a0760c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
6 changes: 2 additions & 4 deletions api/src/main/java/javax/config/ComposedConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@

import javax.config.inject.ConfigProperty;
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
Expand Down Expand Up @@ -231,9 +230,8 @@
*
* @author <a href="mailto:[email protected]">Sebastian Daschner</a>
*/
@Qualifier
@Retention(RUNTIME)
@Target({METHOD, FIELD, PARAMETER, TYPE})
@Target(TYPE)
public @interface ComposedConfig {

/**
Expand Down
11 changes: 0 additions & 11 deletions api/src/main/java/javax/config/ConfigAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@ public interface ConfigAccessor<T> {
*/
ConfigAccessor<T> useConverter(Converter<T> converter);

/**
* Considers the type of the configuration entry a composed type.
* This method enables developers to define the look-up of composed type in scenarios where they cannot annotate
* the composed type with {@link ComposedConfig}. This is the programmatic equivalent of injecting a composed type
* with qualifier {@link ComposedConfig} at the injection point.
*
* @return This builder
* @see ComposedConfig
*/
ConfigAccessor<T> asComposed();

/**
* Sets the default value to use in case the resolution returns null.
* @param value the default value
Expand Down
11 changes: 5 additions & 6 deletions spec/src/main/asciidoc/composed-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ This information is particularly interesting for implementors.

1. The `Config` implementation detects whether the type of a retrieved configuration value is a composed configuration.
This is handled equally, whether the configuration is retrieved programmatically, or via dependency injection.
The configuration value type is considered a composed type if
- the type definition is annotated with the `@ComposedConfig` qualifier
- the dependency injection defines the `@ComposedConfig` qualifier
- the configuration value is access via the `ConfigAccessor` API and it's dedicated `composed()` method
The configuration value type is considered a composed type if the type definition is annotated with `@ComposedConfig`.

2. The retrieval of a composed value MUST be performed by a single config source at a time, in order of their defined priority.
Due to the potential hierarchical nature of composed configuration, the individual sources must define coherent configuration compositions.
Expand Down Expand Up @@ -372,5 +369,7 @@ server.sockets.1.port=443
----


// === Considerations (for EG members)
// - No prefix attribute added on `@ComposedConfig`, since it arguable doesn't provide much benefits. The injection point has to specify some property name anyway.
=== Decisions &amp; Considerations (for EG members, to be removed)
- No prefix attribute added on `@ComposedConfig`, since it arguable doesn't provide much benefits. The injection point has to specify some property name anyway. Discussed on 2018-09-06.
- Starting with supporting to annotate `@ComposedConfig` on types only, i.e. no qualifier and no annotation on the injection point. Discussed on 2018-09-06.
- The programmatic `ConfigAccessor` API doesn't require a specific method (such as `composed()`), since the resolution currently requires the composed type to be annotated with `@ComposedConfig`.

0 comments on commit 8a0760c

Please sign in to comment.