public abstract class ConfigRegistry extends Object
Users of the service are responsible for creating their own configuration objects which are then registered via this class. The config object registry then performs a few functions:
Users of this service will want to use AccessControllers on their configuration
distributed objects to prevent non-administrators from subscribing to or modifying the objects.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConfigRegistry.Serializer
Used to un/serialize object data.
|
| Constructor and Description |
|---|
ConfigRegistry()
Creates a ConfigRegistry that isn't transitioning.
|
ConfigRegistry(boolean transitioning)
Creates a ConfigRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getKeys()
Returns an array containing the keys of all registered configuration objects.
|
DObject |
getObject(String key)
Returns the config object mapped to the specified key, or null if none exists for that key.
|
void |
registerObject(String key,
String path,
DObject object)
Registers the supplied configuration object with the system.
|
void |
setSerializer(ConfigRegistry.Serializer serializer)
Configures the serializer to be used when converting object data to and from its stored
representation.
|
public ConfigRegistry()
public ConfigRegistry(boolean transitioning)
transitioning - if true, serialized Streamable instances stored in the registry will
be written back out immediately to allow them to be transitioned to new class names.public void setSerializer(ConfigRegistry.Serializer serializer)
public void registerObject(String key, String path, DObject object)
key - a string that identifies this object. These are generally hierarchical in nature
(of the form system.subsystem), for example: yohoho.crew.path - The the path in the persistent configuration repository. This may mean
something to the underlying persistent store, for example in the preferences backed
implementation it defines the path to the preferences node in the package hierarchy.object - the object to be registered.public DObject getObject(String key)
public String[] getKeys()
Copyright © 2015. All rights reserved.