Package io.smallrye.config
Class SmallRyeConfigFactory
- java.lang.Object
-
- io.smallrye.config.SmallRyeConfigFactory
-
public abstract class SmallRyeConfigFactory extends Object
A factory which allows a user-provided strategy for locating, creating, and configuring the configuration instance which corresponds to a given class loader. The factory will be searched for on the class loader that was submitted toSmallRyeConfigProviderResolver.getConfig(ClassLoader).Since the factory is given access to a class loader, subclasses are checked for the
getClassLoaderRuntimePermissionon instantiation if a security manager is present.The default implementation will create and configure a configuration with the set of discovered configuration sources, the set of discovered configuration converters and the set of discoverd interceptors from the given class loader.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSmallRyeConfigFactory()Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract SmallRyeConfiggetConfigFor(SmallRyeConfigProviderResolver configProviderResolver, ClassLoader classLoader)Get the configuration object for the given class loader.
-
-
-
Constructor Detail
-
SmallRyeConfigFactory
protected SmallRyeConfigFactory()
Construct a new instance. Callers will be checked for thegetClassLoaderRuntimePermission.
-
-
Method Detail
-
getConfigFor
public abstract SmallRyeConfig getConfigFor(SmallRyeConfigProviderResolver configProviderResolver, ClassLoader classLoader)
Get the configuration object for the given class loader. If the method returnsnull,SmallRyeConfigProviderResolver.getConfig(ClassLoader)will throw an exception for the given class loader indicating that no configuration is available. Any other exception thrown by this method will be thrown directly to callers of the above method.The provided class loader will be
nullif the system class loader isnull. In this case, the system class loader should be used to search for classes or resources.- Parameters:
configProviderResolver- the configuration provider resolver (notnull)classLoader- the class loader (possiblynull)- Returns:
- the configuration object, or
nullif there is no configuration available for the given class loader
-
-