Package io.smallrye.config
Interface ConfigSourceInterceptorFactory
-
@Experimental("Interceptor API to intercept resolution of a configuration name") public interface ConfigSourceInterceptorFactoryThis ConfigSourceInterceptorFactory allows to initialize aConfigSourceInterceptor, with access to the currentConfigSourceInterceptorContext.Interceptors in the chain are initialized in priority order and the current
ConfigSourceInterceptorContextcontains the current interceptor, plus all other interceptors already initialized.Instances of this interface will be discovered by
SmallRyeConfigBuilder.addDiscoveredInterceptors()via theServiceLoadermechanism and can be registered by providing aMETA-INF/services/io.smallrye.config.ConfigSourceInterceptorFactorywhich contains the fully qualified class name of the customConfigSourceInterceptorimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYThe default priority value,Priorities.APPLICATION.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ConfigSourceInterceptorgetInterceptor(ConfigSourceInterceptorContext context)Gets theConfigSourceInterceptorfrom the ConfigSourceInterceptorFactory.default OptionalIntgetPriority()Returns the interceptor priority.
-
-
-
Field Detail
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
The default priority value,Priorities.APPLICATION.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInterceptor
ConfigSourceInterceptor getInterceptor(ConfigSourceInterceptorContext context)
Gets theConfigSourceInterceptorfrom the ConfigSourceInterceptorFactory. Implementations of this method must provide the instance of theConfigSourceInterceptorto add into the Config Interceptor Chain.- Parameters:
context- the currentConfigSourceInterceptorContextwith the interceptors already initialized.- Returns:
- the
ConfigSourceInterceptorto add to Config Interceptor Chain and initialize.
-
getPriority
default OptionalInt getPriority()
Returns the interceptor priority. This is required, because the interceptor priority needs to be sorted before doing initialization.- Returns:
- the priority value.
-
-