-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config with injection #7080
Config with injection #7080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed java files. No docs currently associated with this draft PR. Documentation will be captured in a separate PR.
pico/tests/resources-pico/src/test/resources/expected/module-info.java._pico_
Show resolved
Hide resolved
I have added you because of the comments in the PR description - those are relevant for Config documentation once we merge this. |
Enable Config for injection. Added GlobalConfig to provide capability for overriding the configuration by user
5dc6cfd
to
fa6f147
Compare
Rebased on main and fixed APT dependencies. |
Resolves #7079
Config documentation notes
Helidon config API (helidon-common-config)
There is a new class:
io.helidon.common.config.GlobalConfig
This class can be used to set global configuration to be used by Helidon components. The configuration must be set as the first thing, before Helidon components
are invoked, or Helidon main class is called.
If no configuration is set, the usual
Config.create()
is used to obtain configuration either from default sources, or using meta configuration.Helidon config
ConfigSource interface is now marked as a
@Contract
for Helidon InjectionConfigProducer is a new
@Singleton
service that combines the discoveredConfigSource
from Helidon Injection, with the discovered configuration (from GlobalConfig) and creates a new config (unless an explicit config instance is set usingGlobalConfig
- in such a case it is used AS IS).This means that when
io.helidon.common.Config
is injected into any service using Helidon Injection, this combined config instance will be provided.PR notes
helidon-config dependency had to be removed from all pico modules, so we can generate service code in config module. The tests were moved to appropriate location in
pico/tests
, currently using the same packages, to allow calling package local methods.Wow this caused quite a mayhem in our dependency management for
jakarta.inject-api
. InvestigatingFollow up issue: #7081