Use runServer to start servers, and rename PrefixServer.Module to PrefixModule

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@1018 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Charlie Groves
2010-11-23 22:19:50 +00:00
parent 551bbef355
commit 3782309a2e
5 changed files with 5 additions and 25 deletions
@@ -21,7 +21,6 @@
package com.threerings.micasa.server;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
@@ -47,14 +46,7 @@ public class MiCasaServer extends CrowdServer
{
public static void main (String[] args)
{
Injector injector = Guice.createInjector(new Module());
MiCasaServer server = injector.getInstance(MiCasaServer.class);
try {
server.init(injector);
server.run();
} catch (Exception e) {
log.warning("Unable to initialize server.", e);
}
runServer(new CrowdModule(), new PresentsServerModule(MiCasaServer.class));
}
@Override // from CrowdServer
@@ -68,7 +68,7 @@ public class SimulatorApp
_frame.setController(ctrl);
// create the server
Injector injector = Guice.createInjector(new SimpleServer.Module());
Injector injector = Guice.createInjector(new SimpleServer.CrowdModule());
SimulatorServer server = createSimulatorServer(injector);
server.init(injector, new ResultListener<SimulatorServer>() {
public void requestCompleted (SimulatorServer result) {
@@ -40,7 +40,7 @@ import static com.threerings.stage.Log.log;
public abstract class StageServer extends WhirledServer
{
/** Configures dependencies needed by the Stage services. */
public static class Module extends WhirledServer.Module
public static class StageModule extends WhirledModule
{
@Override protected void configure () {
super.configure();
@@ -39,7 +39,7 @@ import com.threerings.crowd.server.CrowdServer;
public abstract class WhirledServer extends CrowdServer
{
/** Configures dependencies needed by the Whirled server. */
public static class Module extends CrowdServer.Module
public static class WhirledModule extends CrowdModule
{
@Override protected void configure () {
super.configure();
@@ -21,16 +21,11 @@
package com.threerings.parlor;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.parlor.server.ParlorManager;
import static com.threerings.parlor.Log.log;
/**
* A test server for the Parlor services.
*/
@@ -39,14 +34,7 @@ public class TestServer extends CrowdServer
/** Main entry point for test server. */
public static void main (String[] args)
{
Injector injector = Guice.createInjector(new Module());
TestServer server = injector.getInstance(TestServer.class);
try {
server.init(injector);
server.run();
} catch (Exception e) {
log.warning("Unable to initialize server.", e);
}
runServer(new CrowdModule(), new PresentsServerModule(TestServer.class));
}
// we need the parlor manager injected to bootstrap its services