Interface ConfigurationProvider
Allows integrators to provide their default configuration properties for various scopes that would override
Hibernate Search specific ones.
-
Method Summary
Modifier and TypeMethodDescriptionget
(ConfigurationScope scope) Provide a configuration property source for the given scope.default int
priority()
Defines a priority of a particular configuration provider.
-
Method Details
-
get
Provide a configuration property source for the given scope.Property sources created by this provider must follow these rules:
-
A property source only contains properties that are relevant for the given scope.
E.g. a global scope property source should not contain any configuration properties
for a specific index with the
backend.indexes.myindex
prefix; if such a property is defined in a global scope source and then overridden in a backend/index scope (without the prefix), the value will be taken from the global source and backend/index ones will be silently ignored. -
Property keys must be relative to the scope.
No keys should start with
hibernate.search.
prefix. Assuming we want to redefine a propertyhibernate.search.backend.directory.type
in the backend scope, then Hibernate Search would expect that the property source returned by this provider for a backend scope will contain a value for adirectory.type
key. -
For global-scope property sources,
the
bean_configurers
configuration property is only ever looked up if this provider was registered by aBeanConfigurer
added through the JavaServiceLoader
system. A provider registered by aBeanConfigurer
added through thebean_configurers
configuration property cannot itself set thebean_configurers
configuration property.
- Parameters:
scope
- The scope for which configuration properties are about to be used.- Returns:
- An empty optional if the provider does not need to override any Hibernate Search specific defaults
for a provided
scope
, or aConfigurationPropertySource
with overrides otherwise.
-
A property source only contains properties that are relevant for the given scope.
E.g. a global scope property source should not contain any configuration properties
for a specific index with the
-
priority
default int priority()Defines a priority of a particular configuration provider.If multiple configuration providers are available they will be sorted by their
priority
and then by FQCN to guarantee a predictable order.- Returns:
- The priority of the current provider.
-