Revamp! Modified the way configuration is handled.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1166 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// $Id: CrowdConfig.java,v 1.1 2002/03/28 22:32:31 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
import com.samskivert.util.Config;
|
||||
|
||||
/**
|
||||
* Provides access to the Crowd server configuration.
|
||||
*/
|
||||
public class CrowdConfig
|
||||
{
|
||||
/** Provides access to configuration data for this package. */
|
||||
public static Config config = new Config("rsrc/config/crowd/server");
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: CrowdServer.java,v 1.10 2002/03/05 05:33:25 mdb Exp $
|
||||
// $Id: CrowdServer.java,v 1.11 2002/03/28 22:32:31 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
@@ -31,9 +31,6 @@ public class CrowdServer extends PresentsServer
|
||||
// do the presents server initialization
|
||||
super.init();
|
||||
|
||||
// bind the crowd server config into the namespace
|
||||
config.bindProperties(CONFIG_KEY, CONFIG_PATH, true);
|
||||
|
||||
// configure the client manager to use our client
|
||||
clmgr.setClientClass(CrowdClient.class);
|
||||
|
||||
@@ -41,10 +38,12 @@ public class CrowdServer extends PresentsServer
|
||||
clmgr.setClientResolverClass(CrowdClientResolver.class);
|
||||
|
||||
// create our place registry
|
||||
plreg = new PlaceRegistry(config, invmgr, omgr);
|
||||
plreg = new PlaceRegistry(invmgr, omgr);
|
||||
|
||||
// register our invocation service providers
|
||||
registerProviders(config.getValue(PROVIDERS_KEY, (String[])null));
|
||||
String[] providers = null;
|
||||
providers = CrowdConfig.config.getValue(PROVIDERS_KEY, providers);
|
||||
registerProviders(providers);
|
||||
|
||||
Log.info("Crowd server initialized.");
|
||||
}
|
||||
@@ -74,10 +73,6 @@ public class CrowdServer extends PresentsServer
|
||||
/** We use this to map usernames to body objects. */
|
||||
protected static HashMap _bodymap = new HashMap();
|
||||
|
||||
// the path to the config file
|
||||
protected final static String CONFIG_PATH =
|
||||
"rsrc/config/crowd/server";
|
||||
|
||||
// the config key for our list of invocation provider mappings
|
||||
protected final static String PROVIDERS_KEY = CONFIG_KEY + ".providers";
|
||||
/** The config key for our list of invocation provider mappings. */
|
||||
protected final static String PROVIDERS_KEY = "providers";
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
//
|
||||
// $Id: PlaceRegistry.java,v 1.18 2001/12/14 00:11:17 mdb Exp $
|
||||
// $Id: PlaceRegistry.java,v 1.19 2002/03/28 22:32:31 mdb Exp $
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.samskivert.util.Config;
|
||||
import com.samskivert.util.HashIntMap;
|
||||
import com.samskivert.util.Tuple;
|
||||
import com.samskivert.util.Queue;
|
||||
@@ -49,8 +48,7 @@ public class PlaceRegistry
|
||||
* Creates and initializes the place registry; called by the server
|
||||
* during its initialization phase.
|
||||
*/
|
||||
public PlaceRegistry (Config config, InvocationManager invmgr,
|
||||
RootDObjectManager omgr)
|
||||
public PlaceRegistry (InvocationManager invmgr, RootDObjectManager omgr)
|
||||
{
|
||||
// we'll need this later
|
||||
_omgr = omgr;
|
||||
|
||||
Reference in New Issue
Block a user