- Enclosing class:
Use if the configuration may be provided by another module not known to us.
To control whether to discover services or not, you can specify a key
on the same level as the section for the provider based property. This is aligned with the generated methods on the
builder, and allows for the shallowest possible configuration tree (this would override
defined on this annotation).
Also there is no difference regardless whether we return a single value, or a list of values.
If the method returns a list, the provider configuration must be under config key
the configured option. On the same level as
providers, there can be
myProvider that returns a single provider, or an
Optional provider example
my-type: my-provider: provider-id: provider-key1: "providerValue" provider-key2: "providerValue"
myProviders that returns a list of providers in configuration:
my-type: my-providers-discover-services: true # default of this value is controlled by annotation my-providers: provider-id: provider-key1: "providerValue" provider-key2: "providerValue" provider2-id: provider2-key1: "provider2Value"
Required Element Summary
Optional Element SummaryModifier and TypeOptional ElementDescription
booleanWhether to discover all services using a service loader by default.
valueClass<?> valueThe service provider interface that is used to discover implementations. The type of the property is the service provided by that provider.
- type of the provider
discoverServicesboolean discoverServicesWhether to discover all services using a service loader by default. When set to
true, all services discovered by the service loader will be added (even if no configuration node exists for them). When set to
false, only services that have a configuration node will be added. This can be overridden by
discover-servicesconfiguration option under this option's key.
- whether to discover services by default for a provider