public class ConfigMemoryStore extends ConfigStore
Points to a file system directory containing configuration files.
Modifier and Type | Field and Description |
---|---|
static ConfigMemoryStore |
DEFAULT
Default memory store, all default values.
|
Modifier | Constructor and Description |
---|---|
protected |
ConfigMemoryStore(PropertyStore ps)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ConfigMemoryStoreBuilder |
builder()
Creates a builder from this context object.
|
void |
close()
No-op.
|
static ConfigMemoryStoreBuilder |
create()
Create a new builder for this object.
|
String |
read(String name)
Returns the contents of the configuration file.
|
ConfigMemoryStore |
update(String name,
String newContents)
Called when the physical contents of a config file have changed.
|
String |
write(String name,
String expectedContents,
String newContents)
Saves the contents of the configuration file if the underlying storage hasn't been modified.
|
createDefaultSessionArgs, createSession, getMap, register, unregister, update
asMap, createSession, equals, getArrayProperty, getArrayProperty, getBooleanProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, hashCode, toString
public static final ConfigMemoryStore DEFAULT
protected ConfigMemoryStore(PropertyStore ps)
ps
- The settings for this content store.public static ConfigMemoryStoreBuilder create()
public ConfigMemoryStoreBuilder builder()
Context
Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
public String read(String name)
ConfigStore
read
in class ConfigStore
name
- The config file name.public String write(String name, String expectedContents, String newContents)
ConfigStore
write
in class ConfigStore
name
- The config file name.expectedContents
- The expected contents of the file.newContents
- The new contents.public ConfigMemoryStore update(String name, String newContents)
ConfigStore
Triggers calls to ConfigStoreListener.onChange(String)
on all registered listeners.
update
in class ConfigStore
name
- The config name (e.g. the filename without the extension).newContents
- The new contents.public void close() throws IOException
IOException
Copyright © 2018 Apache. All rights reserved.