Made it possible to disable client and connection managers for testing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@609 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsServer.java,v 1.15 2001/11/08 02:59:30 mdb Exp $
|
||||
// $Id: PresentsServer.java,v 1.16 2001/11/08 05:39:51 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
@@ -57,9 +57,11 @@ public class PresentsServer
|
||||
// create our authentication manager
|
||||
authmgr = new AuthManager(new DummyAuthenticator());
|
||||
// create our connection manager
|
||||
conmgr = new ConnectionManager(config, authmgr);
|
||||
// create our client manager
|
||||
clmgr = new ClientManager(conmgr);
|
||||
if (createConnectionManager()) {
|
||||
conmgr = new ConnectionManager(config, authmgr);
|
||||
// create our client manager
|
||||
clmgr = new ClientManager(conmgr);
|
||||
}
|
||||
// create our distributed object manager
|
||||
omgr = new PresentsDObjectMgr();
|
||||
// create our invocation manager
|
||||
@@ -117,6 +119,16 @@ public class PresentsServer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* In local testing mode, we don't want to create a connection manager
|
||||
* and listen to client connections. So we provide this method that
|
||||
* can be overridden by a testing server.
|
||||
*/
|
||||
protected boolean createConnectionManager ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts up all of the server services and enters the main server
|
||||
* event loop.
|
||||
@@ -126,7 +138,9 @@ public class PresentsServer
|
||||
// start up the auth manager
|
||||
authmgr.start();
|
||||
// start up the connection manager
|
||||
conmgr.start();
|
||||
if (conmgr != null) {
|
||||
conmgr.start();
|
||||
}
|
||||
// invoke the dobjmgr event loop
|
||||
omgr.run();
|
||||
}
|
||||
@@ -138,7 +152,9 @@ public class PresentsServer
|
||||
{
|
||||
// shut down our managers
|
||||
authmgr.shutdown();
|
||||
conmgr.shutdown();
|
||||
if (conmgr != null) {
|
||||
conmgr.shutdown();
|
||||
}
|
||||
omgr.shutdown();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user