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:
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.micasa.server;
|
package com.threerings.micasa.server;
|
||||||
|
|
||||||
import com.google.inject.Guice;
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
|
|
||||||
@@ -47,14 +46,7 @@ public class MiCasaServer extends CrowdServer
|
|||||||
{
|
{
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
{
|
{
|
||||||
Injector injector = Guice.createInjector(new Module());
|
runServer(new CrowdModule(), new PresentsServerModule(MiCasaServer.class));
|
||||||
MiCasaServer server = injector.getInstance(MiCasaServer.class);
|
|
||||||
try {
|
|
||||||
server.init(injector);
|
|
||||||
server.run();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warning("Unable to initialize server.", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from CrowdServer
|
@Override // from CrowdServer
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class SimulatorApp
|
|||||||
_frame.setController(ctrl);
|
_frame.setController(ctrl);
|
||||||
|
|
||||||
// create the server
|
// create the server
|
||||||
Injector injector = Guice.createInjector(new SimpleServer.Module());
|
Injector injector = Guice.createInjector(new SimpleServer.CrowdModule());
|
||||||
SimulatorServer server = createSimulatorServer(injector);
|
SimulatorServer server = createSimulatorServer(injector);
|
||||||
server.init(injector, new ResultListener<SimulatorServer>() {
|
server.init(injector, new ResultListener<SimulatorServer>() {
|
||||||
public void requestCompleted (SimulatorServer result) {
|
public void requestCompleted (SimulatorServer result) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import static com.threerings.stage.Log.log;
|
|||||||
public abstract class StageServer extends WhirledServer
|
public abstract class StageServer extends WhirledServer
|
||||||
{
|
{
|
||||||
/** Configures dependencies needed by the Stage services. */
|
/** Configures dependencies needed by the Stage services. */
|
||||||
public static class Module extends WhirledServer.Module
|
public static class StageModule extends WhirledModule
|
||||||
{
|
{
|
||||||
@Override protected void configure () {
|
@Override protected void configure () {
|
||||||
super.configure();
|
super.configure();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import com.threerings.crowd.server.CrowdServer;
|
|||||||
public abstract class WhirledServer extends CrowdServer
|
public abstract class WhirledServer extends CrowdServer
|
||||||
{
|
{
|
||||||
/** Configures dependencies needed by the Whirled server. */
|
/** Configures dependencies needed by the Whirled server. */
|
||||||
public static class Module extends CrowdServer.Module
|
public static class WhirledModule extends CrowdModule
|
||||||
{
|
{
|
||||||
@Override protected void configure () {
|
@Override protected void configure () {
|
||||||
super.configure();
|
super.configure();
|
||||||
|
|||||||
@@ -21,16 +21,11 @@
|
|||||||
|
|
||||||
package com.threerings.parlor;
|
package com.threerings.parlor;
|
||||||
|
|
||||||
import com.google.inject.Guice;
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Injector;
|
|
||||||
|
|
||||||
import com.threerings.crowd.server.CrowdServer;
|
import com.threerings.crowd.server.CrowdServer;
|
||||||
|
|
||||||
import com.threerings.parlor.server.ParlorManager;
|
import com.threerings.parlor.server.ParlorManager;
|
||||||
|
|
||||||
import static com.threerings.parlor.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A test server for the Parlor services.
|
* A test server for the Parlor services.
|
||||||
*/
|
*/
|
||||||
@@ -39,14 +34,7 @@ public class TestServer extends CrowdServer
|
|||||||
/** Main entry point for test server. */
|
/** Main entry point for test server. */
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
{
|
{
|
||||||
Injector injector = Guice.createInjector(new Module());
|
runServer(new CrowdModule(), new PresentsServerModule(TestServer.class));
|
||||||
TestServer server = injector.getInstance(TestServer.class);
|
|
||||||
try {
|
|
||||||
server.init(injector);
|
|
||||||
server.run();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warning("Unable to initialize server.", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need the parlor manager injected to bootstrap its services
|
// we need the parlor manager injected to bootstrap its services
|
||||||
|
|||||||
Reference in New Issue
Block a user