|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.admin.server.ConfigRegistry
public abstract class ConfigRegistry
Provides a registry of configuration distributed objects. Using distributed object to store runtime configuration data can be exceptionally useful in that clients (with admin privileges) can view and update the running server's configuration parameters on the fly.
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.
| Nested Class Summary | |
|---|---|
protected class |
ConfigRegistry.ObjectRecord
Contains all necessary info for a configuration object registration. |
| Field Summary | |
|---|---|
protected HashMap<String,ConfigRegistry.ObjectRecord> |
_configs
A mapping from identifying key to config object. |
protected boolean |
_transitioning
If we need to transition serialized Streamables to a new class format in init.. |
| Constructor Summary | |
|---|---|
ConfigRegistry()
Creates a ConfigRegistry that isn't transitioning. |
|
ConfigRegistry(boolean transitioning)
Creates a ConfigRegistry. |
|
| Method Summary | |
|---|---|
protected ObjectInputStream |
createObjectInputStream(InputStream bin)
Create an ObjectInputStream to read serialized config entries. |
protected ObjectOutputStream |
createObjectOutputStream(OutputStream bin)
Create an ObjectOutputStream to write serialized config entries. |
protected abstract ConfigRegistry.ObjectRecord |
createObjectRecord(String path,
DObject object)
Creates an object record derivation that will handle the management of the specified object. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap<String,ConfigRegistry.ObjectRecord> _configs
protected boolean _transitioning
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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()
protected abstract ConfigRegistry.ObjectRecord createObjectRecord(String path,
DObject object)
protected ObjectInputStream createObjectInputStream(InputStream bin)
protected ObjectOutputStream createObjectOutputStream(OutputStream bin)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||