Package com.hazelcast.client.config
Class XmlClientConfigBuilder
java.lang.Object
com.hazelcast.config.AbstractConfigBuilder
com.hazelcast.config.AbstractXmlConfigHelper
com.hazelcast.config.AbstractXmlConfigBuilder
com.hazelcast.client.config.XmlClientConfigBuilder
Loads the
ClientConfig
using XML.-
Nested Class Summary
Nested classes/interfaces inherited from class com.hazelcast.config.AbstractXmlConfigBuilder
AbstractXmlConfigBuilder.ConfigType
-
Field Summary
Fields inherited from class com.hazelcast.config.AbstractXmlConfigHelper
domLevel3
-
Constructor Summary
ConstructorDescriptionLoads the client config using the following resolution mechanism: first it checks if a system property 'hazelcast.client.config' is set.XmlClientConfigBuilder
(com.hazelcast.client.config.impl.XmlClientConfigLocator locator) Constructs aXmlClientConfigBuilder
that loads the configuration with the providedXmlClientConfigLocator
.XmlClientConfigBuilder
(File file) XmlClientConfigBuilder
(String resource) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
build
(ClassLoader classLoader) protected AbstractXmlConfigBuilder.ConfigType
protected Document
parse
(InputStream inputStream) Reads XML from InputStream and parses.setProperties
(Properties properties) Methods inherited from class com.hazelcast.config.AbstractXmlConfigBuilder
getProperties, process, setPropertiesInternal
Methods inherited from class com.hazelcast.config.AbstractXmlConfigHelper
appendToken, getNamespaceType, getReleaseVersion, loadSchemaFile, schemaValidation, xmlToJavaName
Methods inherited from class com.hazelcast.config.AbstractConfigBuilder
shouldValidateTheSchema
-
Constructor Details
-
XmlClientConfigBuilder
- Throws:
IOException
-
XmlClientConfigBuilder
- Throws:
IOException
-
XmlClientConfigBuilder
- Throws:
IOException
-
XmlClientConfigBuilder
-
XmlClientConfigBuilder
public XmlClientConfigBuilder()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 `.xml`.
- it checks if a hazelcast-client.xml is available in the working dir
- it checks if a hazelcast-client.xml is available on the classpath
- it loads the hazelcast-client-default.xml
-
XmlClientConfigBuilder
@PrivateApi public XmlClientConfigBuilder(com.hazelcast.client.config.impl.XmlClientConfigLocator locator) Constructs aXmlClientConfigBuilder
that loads the configuration with the providedXmlClientConfigLocator
.If the provided
XmlClientConfigLocator
isnull
, a new instance is created and the config is located in every possible places. For these places, please seeXmlClientConfigLocator
.If the provided
XmlClientConfigLocator
is notnull
, it is expected that it already located the configuration XML to load from. No further attempt to locate the configuration XML is made if the configuration XML is not located already.- Parameters:
locator
- the configured locator to use
-
-
Method Details
-
parse
Description copied from class:AbstractXmlConfigBuilder
Reads XML from InputStream and parses.- Specified by:
parse
in classAbstractXmlConfigBuilder
- Parameters:
inputStream
-InputStream
to read from- Returns:
- Document after parsing XML
- Throws:
Exception
- if the XML configuration cannot be parsed or is invalid
-
setProperties
-
getConfigType
- Specified by:
getConfigType
in classAbstractXmlConfigBuilder
- Returns:
- ConfigType of current config class as enum value
-
build
-
build
-