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 intpriority()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.myindexprefix; 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.typein 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.typekey. -
For global-scope property sources,
the
bean_configurersconfiguration property is only ever looked up if this provider was registered by aBeanConfigureradded through the JavaServiceLoadersystem. A provider registered by aBeanConfigureradded through thebean_configurersconfiguration property cannot itself set thebean_configurersconfiguration 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 aConfigurationPropertySourcewith 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
priorityand then by FQCN to guarantee a predictable order.- Returns:
- The priority of the current provider.
-