com.threerings.admin.server
Class DatabaseConfigRegistry

java.lang.Object
  extended by com.threerings.admin.server.ConfigRegistry
      extended by com.threerings.admin.server.DatabaseConfigRegistry
Direct Known Subclasses:
PeeredDatabaseConfigRegistry

public class DatabaseConfigRegistry
extends ConfigRegistry

Implements the ConfigRegistry using a JDBC database as a persistent store for the configuration information. Note: config objects should only be created during server startup because they will result in synchronous requests to load up the initial configuration data from the database. This ensures that systems initialized after the config registry can safely make use of configuration information.


Nested Class Summary
protected  class DatabaseConfigRegistry.DatabaseObjectRecord
          Stores settings in a database.
 
Nested classes/interfaces inherited from class com.threerings.admin.server.ConfigRegistry
ConfigRegistry.ObjectRecord
 
Field Summary
protected  Invoker _invoker
           
protected  String _node
           
protected  ConfigRepository _repo
           
 
Fields inherited from class com.threerings.admin.server.ConfigRegistry
_configs, _transitioning
 
Constructor Summary
DatabaseConfigRegistry(PersistenceContext ctx, Invoker invoker)
          Creates a configuration registry and prepares it for operation.
DatabaseConfigRegistry(PersistenceContext ctx, Invoker invoker, boolean transitioning)
          Creates a configuration registry and prepares it for operation.
DatabaseConfigRegistry(PersistenceContext ctx, Invoker invoker, String node)
          Creates a configuration registry and prepares it for operation.
DatabaseConfigRegistry(PersistenceContext ctx, Invoker invoker, String node, boolean transitioning)
          Creates a configuration registry and prepares it for operation.
 
Method Summary
protected  ConfigRegistry.ObjectRecord createObjectRecord(String path, DObject object)
          Creates an object record derivation that will handle the management of the specified object.
 
Methods inherited from class com.threerings.admin.server.ConfigRegistry
createObjectInputStream, createObjectOutputStream, getKeys, getObject, registerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_repo

protected ConfigRepository _repo

_invoker

protected Invoker _invoker

_node

protected String _node
Constructor Detail

DatabaseConfigRegistry

@Inject
public DatabaseConfigRegistry(PersistenceContext ctx,
                                     Invoker invoker)
Creates a configuration registry and prepares it for operation.

Parameters:
ctx - will provide access to our database.
invoker - this will be used to perform all database activity (except first time initialization) so as to avoid blocking the distributed object thread.

DatabaseConfigRegistry

public DatabaseConfigRegistry(PersistenceContext ctx,
                              Invoker invoker,
                              boolean transitioning)
Creates a configuration registry and prepares it for operation.

Parameters:
ctx - will provide access to our database.
invoker - this will be used to perform all database activity (except first time initialization) so as to avoid blocking the distributed object thread.
transitioning - if the values in the database need to be transitioned to a new format

DatabaseConfigRegistry

public DatabaseConfigRegistry(PersistenceContext ctx,
                              Invoker invoker,
                              String node)
Creates a configuration registry and prepares it for operation.

Parameters:
ctx - will provide access to our database.
invoker - this will be used to perform all database activity (except first time initialization) so as to avoid blocking the distributed object thread.
node - if this config registry is accessed by multiple servers which wish to maintain separate configs, then specify a node for each server

DatabaseConfigRegistry

public DatabaseConfigRegistry(PersistenceContext ctx,
                              Invoker invoker,
                              String node,
                              boolean transitioning)
Creates a configuration registry and prepares it for operation.

Parameters:
ctx - will provide access to our database.
invoker - this will be used to perform all database activity (except first time initialization) so as to avoid blocking the distributed object thread.
node - if this config registry is accessed by multiple servers which wish to maintain separate configs, then specify a node for each server
transitioning - if the values in the database need to be transitioned to a new format
Method Detail

createObjectRecord

protected ConfigRegistry.ObjectRecord createObjectRecord(String path,
                                                         DObject object)
Description copied from class: ConfigRegistry
Creates an object record derivation that will handle the management of the specified object.

Specified by:
createObjectRecord in class ConfigRegistry