java.lang.Object
io.helidon.common.config.GlobalConfig
Deprecated, for removal: This API element is subject to removal in a future version.
Global configuration can be set by a user before any Helidon code is invoked, to override default discovery
of configuration done by Helidon components.
If method config(java.util.function.Supplier)
is called before Helidon is started, Helidon will only use that
configuration.
You may still use custom instances of configuration when using configurable APIs directly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Config
config()
Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
insteadstatic Config
Deprecated, for removal: This API element is subject to removal in a future version.useServices.set(Class, Object[])
insteadstatic Config
Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
insteadstatic boolean
Deprecated, for removal: This API element is subject to removal in a future version.Whether a global configuration has already been configured.
-
Method Details
-
configured
public static boolean configured()Deprecated, for removal: This API element is subject to removal in a future version.Whether a global configuration has already been configured.- Returns:
true
if there is a global configuration set already,false
otherwise
-
config
Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
insteadGlobal configuration instance.- Returns:
- Helidon shared configuration instance if configured, or an empty configuration if not
- See Also:
-
config
Deprecated, for removal: This API element is subject to removal in a future version.useServices.set(Class, Object[])
insteadSet global configuration if not yet configured.- Parameters:
config
- configuration supplier to use if config is not yet configured- Returns:
- used global configuration instance
-
config
@Deprecated(forRemoval=true, since="4.2.0") public static Config config(Supplier<Config> config, boolean overwrite) Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(Class)
insteadSet global configuration.- Parameters:
config
- configuration to useoverwrite
- whether to overwrite an existing configured value- Returns:
- current global config
-
Services.get(Class)
, orServiceRegistry.get(Class)
if you have an instance ready to obtain the "global" configuration; in case you are writing a registry service, simply inject the config instance; useServices.set(Class, Object[])
to use a custom instance of configuration, just make sure it is registered before it is used the first time