@ConfigurableContext 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.
|
boolean |
exists(String name)
Checks whether the configuration with the specified name exists in this store.
|
String |
read(String name)
Returns the contents of the configuration file.
|
ObjectMap |
toMap()
Returns the properties defined on this bean context as a simple map for debugging purposes.
|
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, resolveName, unregister, update
createSession, equals, getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, 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, getStringPropertyWithNone, hashCode, identityCode, 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 boolean exists(String name)
ConfigStore
exists
in class ConfigStore
name
- The config name.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
public ObjectMap toMap()
Context
toMap
in class ConfigStore
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.