Package com.hazelcast.client.config
Class YamlClientConfigBuilder
- java.lang.Object
-
- com.hazelcast.config.AbstractConfigBuilder
-
- com.hazelcast.config.AbstractYamlConfigBuilder
-
- com.hazelcast.client.config.YamlClientConfigBuilder
-
public class YamlClientConfigBuilder extends AbstractYamlConfigBuilder
Loads theClientConfig
using YAML.
-
-
Constructor Summary
Constructors Constructor Description YamlClientConfigBuilder()
Loads the client config using the following resolution mechanism: first it checks if a system property 'hazelcast.client.config' is set.YamlClientConfigBuilder(com.hazelcast.client.config.impl.YamlClientConfigLocator locator)
Constructs aYamlClientConfigBuilder
that loads the configuration with the providedYamlClientConfigLocator
.YamlClientConfigBuilder(java.io.File file)
YamlClientConfigBuilder(java.io.InputStream in)
YamlClientConfigBuilder(java.lang.String resource)
YamlClientConfigBuilder(java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientConfig
build()
ClientConfig
build(java.lang.ClassLoader classLoader)
protected java.lang.String
getConfigRoot()
YamlClientConfigBuilder
setProperties(java.util.Properties properties)
-
Methods inherited from class com.hazelcast.config.AbstractYamlConfigBuilder
getProperties, importDocuments, replaceVariables, setPropertiesInternal
-
Methods inherited from class com.hazelcast.config.AbstractConfigBuilder
shouldValidateTheSchema
-
-
-
-
Constructor Detail
-
YamlClientConfigBuilder
public YamlClientConfigBuilder(java.lang.String resource) throws java.io.IOException
- Throws:
java.io.IOException
-
YamlClientConfigBuilder
public YamlClientConfigBuilder(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
YamlClientConfigBuilder
public YamlClientConfigBuilder(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
YamlClientConfigBuilder
public YamlClientConfigBuilder(java.io.InputStream in)
-
YamlClientConfigBuilder
public YamlClientConfigBuilder()
Loads the client config using the following resolution mechanism:- first it checks if a system property 'hazelcast.client.config' is set. If it exist and it begins with 'classpath:', then a classpath resource is loaded. Else it will assume it is a file reference. The configuration file or resource will be loaded only if the postfix of its name ends with `.yaml`.
- it checks if a hazelcast-client.yaml is available in the working dir
- it checks if a hazelcast-client.yaml is available on the classpath
- it loads the hazelcast-client-default.yaml
-
YamlClientConfigBuilder
@PrivateApi public YamlClientConfigBuilder(com.hazelcast.client.config.impl.YamlClientConfigLocator locator)
Constructs aYamlClientConfigBuilder
that loads the configuration with the providedYamlClientConfigLocator
.If the provided
YamlClientConfigLocator
isnull
, a new instance is created and the config is located in every possible places. For these places, please seeYamlClientConfigLocator
.If the provided
YamlClientConfigLocator
is notnull
, it is expected that it already located the configuration YAML to load from. No further attempt to locate the configuration YAML is made if the configuration YAML is not located already.- Parameters:
locator
- the configured locator to use
-
-
Method Detail
-
build
public ClientConfig build()
-
build
public ClientConfig build(java.lang.ClassLoader classLoader)
-
setProperties
public YamlClientConfigBuilder setProperties(java.util.Properties properties)
-
getConfigRoot
protected java.lang.String getConfigRoot()
- Specified by:
getConfigRoot
in classAbstractYamlConfigBuilder
-
-