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 to SmallRyeConfigProviderResolver.getConfig(ClassLoader).

Since the factory is given access to a class loader, subclasses are checked for the getClassLoader RuntimePermission on 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 Details

    • SmallRyeConfigFactory

      protected SmallRyeConfigFactory()
      Construct a new instance. Callers will be checked for the getClassLoader RuntimePermission.
  • Method Details

    • getConfigFor

      public abstract SmallRyeConfig getConfigFor(SmallRyeConfigProviderResolver configProviderResolver, ClassLoader classLoader)
      Get the configuration object for the given class loader. If the method returns null, 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 null if the system class loader is null. In this case, the system class loader should be used to search for classes or resources.

      Parameters:
      configProviderResolver - the configuration provider resolver (not null)
      classLoader - the class loader (possibly null)
      Returns:
      the configuration object, or null if there is no configuration available for the given class loader