Basic Guice compliance.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@614 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-06-07 17:45:30 +00:00
parent 2090bcdfeb
commit 0a2b8b8f52
9 changed files with 80 additions and 59 deletions
@@ -21,6 +21,9 @@
package com.threerings.parlor;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.parlor.server.ParlorManager;
@@ -35,11 +38,11 @@ public class TestServer extends CrowdServer
/** The parlor manager in operation on this server. */
public static ParlorManager parmgr = new ParlorManager();
/** Initializes the Parlor test server. */
public void init ()
@Override // from CrowdServer
public void init (Injector injector)
throws Exception
{
super.init();
super.init(injector);
// initialize our parlor manager
parmgr.init(invmgr, plreg);
@@ -50,9 +53,10 @@ public class TestServer extends CrowdServer
/** Main entry point for test server. */
public static void main (String[] args)
{
TestServer server = new TestServer();
Injector injector = Guice.createInjector(new Module());
TestServer server = injector.getInstance(TestServer.class);
try {
server.init();
server.init(injector);
server.run();
} catch (Exception e) {
log.warning("Unable to initialize server.", e);