public interface ConfigSource
Implement this interfaces to provide a ConfigSource. A ConfigSource provides configuration values from a specific place, like JNDI configuration, a properties file, etc. A ConfigSource is always read-only, any potential updates of the configured values must be handled directly inside each ConfigSource.
The default config sources always available by default are:
Custom ConfigSource will get picked up via the ServiceLoader
mechanism and and can be registered by
providing a file
META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourcewhich contains the fully qualified
ConfigSource
implementation class name as content.
Adding a dynamic amount of custom config sources can be done programmatically via
ConfigSourceProvider
.
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_ORDINAL |
Modifier and Type | Method and Description |
---|---|
String |
getName()
The name of the config might be used for logging or analysis of configured values.
|
default int |
getOrdinal()
Return the ordinal for this config source.
|
Map<String,String> |
getProperties()
Return the properties in this config source
|
default Set<String> |
getPropertyNames()
Gets all property names known to this config source, without evaluating the values.
|
String |
getValue(String propertyName)
Return the value for the specified property in this config source.
|
static final String CONFIG_ORDINAL
Map<String,String> getProperties()
default Set<String> getPropertyNames()
getProperties()
slower ConfigSource implementations should replace this with a more performant implementationdefault int getOrdinal()
String getValue(String propertyName)
propertyName
- the property nameString getName()
Copyright © 2018 Eclipse Foundation. All rights reserved.