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, getStanbyUrls, getStandBy, getWriteLock, hasStandbyUrl, reloadXML
public RWSConfigFactory(long currentVersion, InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException
Constructor for RWSConfigFactory.
currentVersion
- a long.stream
- a InputStream
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.public static void init() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- Thrown if the specified config file cannot be readorg.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- 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/loadedorg.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.IOException
- if any.public void update() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
update
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.Copyright © 2017. All rights reserved.