Class ClasspathYamlConfig

java.lang.Object
com.hazelcast.config.Config
com.hazelcast.config.ClasspathYamlConfig

public class ClasspathYamlConfig extends Config
A Config which is initialized by loading a YAML configuration file from the classpath.

Unlike Config.loadFromClasspath(ClassLoader, String) and its variants, a configuration constructed via ClasspathYamlConfig does not apply overrides found in environment variables/system properties.

See Also:
  • Constructor Details

    • ClasspathYamlConfig

      public ClasspathYamlConfig(String resource)
      Creates a config which is loaded from a classpath resource using the Thread.currentThread() contextClassLoader. The System.properties are used to resolve variables in the YAML.
      Parameters:
      resource - the resource, a YAML configuration file from the classpath, without the "classpath:" prefix
      Throws:
      IllegalArgumentException - if the resource could not be found
      InvalidConfigurationException - if the YAML content is invalid
    • ClasspathYamlConfig

      public ClasspathYamlConfig(String resource, Properties properties)
      Creates a config which is loaded from a classpath resource using the Thread.currentThread() contextClassLoader.
      Parameters:
      resource - the resource, a YAML configuration file from the classpath, without the "classpath:" prefix
      properties - the Properties to resolve variables in the YAML
      Throws:
      IllegalArgumentException - if the resource could not be found or if properties is null
      InvalidConfigurationException - if the YAML content is invalid
    • ClasspathYamlConfig

      public ClasspathYamlConfig(ClassLoader classLoader, String resource)
      Creates a config which is loaded from a classpath resource. The System.properties are used to resolve variables in the YAML.
      Parameters:
      classLoader - the ClassLoader used to load the resource
      resource - the resource, a YAML configuration file from the classpath, without the "classpath:" prefix
      Throws:
      IllegalArgumentException - if classLoader or resource is null, or if the resource is not found
      InvalidConfigurationException - if the YAML content is invalid
    • ClasspathYamlConfig

      public ClasspathYamlConfig(ClassLoader classLoader, String resource, Properties properties)
      Creates a config which is loaded from a classpath resource.
      Parameters:
      classLoader - the ClassLoader used to load the resource
      resource - the resource, a YAML configuration file from the classpath, without the "classpath:" prefix
      properties - the properties used to resolve variables in the YAML
      Throws:
      IllegalArgumentException - if classLoader or resource is null, or if the resource is not found
      InvalidConfigurationException - if the YAML content is invalid