public final class RWSConfigFactory extends RWSConfigManager
Constructor and Description |
---|
RWSConfigFactory(long currentVersion,
InputStream stream)
Constructor for RWSConfigFactory.
|
Modifier and Type | Method and Description |
---|---|
static RWSConfig |
getInstance()
Return the singleton instance of this factory.
|
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
protected void |
saveXml(String xml)
Reload the config from the default config file
|
static void |
setInstance(RWSConfig instance)
setInstance
|
void |
update()
update
|
getBase, getBaseUrl, getConfiguration, getNextStandBy, getNextStandbyUrl, getReadLock, getStandBy, getStandbyUrls, getWriteLock, hasStandbyUrl, reloadXML
public RWSConfigFactory(long currentVersion, InputStream stream) throws IOException
Constructor for RWSConfigFactory.
currentVersion
- a long.stream
- a InputStream
object.IOException
- if any.public static void init() throws IOException
IOException
- Thrown if the specified config file cannot be readIOException
- if any.public static RWSConfig getInstance()
IllegalStateException
- Thrown if the factory has not yet been initialized.public static void setInstance(RWSConfig instance)
setInstance
instance
- a RWSConfig
object.protected void saveXml(String xml) throws IOException
xml
- a String
object.IOException
- Thrown if the specified config file cannot be read/loadedIOException
- if any.public void update() throws IOException
update
IOException
- if any.Copyright © 2021. All rights reserved.