public class InMemoryConfiguration extends Object implements Configuration
Configuration.ConfigStorageType, Configuration.NodeFactory
BatchRunner.Batch
Modifier and Type | Field and Description |
---|---|
private Map<String,Object> |
root |
CONF_STORAGE_SYSTEM_PROP, OLOCK_HASH_KEY, REFERENCE_BY_UUID_PATTERN, REFERENCE_KEY, UUID_KEY, WEAK_REFERENCE_KEY
Constructor and Description |
---|
InMemoryConfiguration() |
InMemoryConfiguration(Map<String,Object> root) |
Modifier and Type | Method and Description |
---|---|
Object |
getConfigurationNode(Path path,
Class configurableClass)
Loads a configuration node under the specified path.
|
Map<String,Object> |
getConfigurationRoot()
Return the root of the configuration tree.
|
Path |
getPathByUUID(String uuid) |
void |
lock()
Aquire a global pessimistic lock (cluster-aware implementations should ensure that only a single node can aquire the lock at a time)
Subsequent calls from the same transaction should not block.
|
boolean |
nodeExists(Path path)
Tests if a node under the specified path exists.
|
void |
persistNode(Path path,
Map<String,Object> configNode,
Class configurableClass)
Persists the configuration node to the specified path.
|
void |
refreshNode(Path path)
Invalidates any present cached state for the node
It is imperative that some other nodes might also be refreshed during the operation.
|
void |
removeNode(Path path)
Removes a configuration node under the specified path with all its children permanently
|
void |
runBatch(BatchRunner.Batch batch)
Provides support for batching configuration changes.
|
Iterator |
search(String liteXPathExpression)
Performs a search on the configuration tree and returns an iterator to configuration nodes that satisfy the search criteria.
|
public InMemoryConfiguration()
public InMemoryConfiguration(Map<String,Object> root)
public Map<String,Object> getConfigurationRoot() throws ConfigurationException
Configuration
getConfigurationRoot
in interface Configuration
ConfigurationException
public Object getConfigurationNode(Path path, Class configurableClass) throws ConfigurationException
Configuration
getConfigurationNode
in interface Configuration
path
- A reference to a nodeConfigurationException
public boolean nodeExists(Path path) throws ConfigurationException
Configuration
nodeExists
in interface Configuration
ConfigurationException
public void refreshNode(Path path) throws ConfigurationException
Configuration
refreshNode
in interface Configuration
ConfigurationException
public void persistNode(Path path, Map<String,Object> configNode, Class configurableClass) throws ConfigurationException
Configuration
persistNode
in interface Configuration
path
- path to the nodeconfigNode
- configuration node to persistconfigurableClass
- class annotated with ConfigurableClass, ConfigurableProperty annotations that corresponds to this node.ConfigurationException
public void removeNode(Path path) throws ConfigurationException
Configuration
removeNode
in interface Configuration
ConfigurationException
public Path getPathByUUID(String uuid)
getPathByUUID
in interface Configuration
public Iterator search(String liteXPathExpression) throws IllegalArgumentException, ConfigurationException
Configuration
search
in interface Configuration
liteXPathExpression
- Must be absolute path, no double slashes, no @attributes (only [attr=val] or [attr<>val])IllegalArgumentException
ConfigurationException
public void lock()
Configuration
lock
in interface Configuration
public void runBatch(BatchRunner.Batch batch)
BatchRunner
runBatch
in interface BatchRunner
batch
- Configuration batch change to executeCopyright © 2017 dcm4che.org. All rights reserved.