Created a peer-aware DatabaseConfigRegistry that broadcasts changed runtime
configuration information to other peers so that they all remain in sync. Also nixed constructor arguments to the peer manager so that it can be created at server construct time like all other managers and be available for the twisty maze of inter-registration that takes place during the manager init process. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4814 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -128,17 +128,6 @@ public class PeerManager
|
||||
public void fail (String peerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a peer manager which will create a {@link NodeRepository} which will be used to
|
||||
* publish our existence and discover the other nodes.
|
||||
*/
|
||||
public PeerManager (PersistenceContext ctx, Invoker invoker)
|
||||
{
|
||||
_invoker = invoker;
|
||||
_noderepo = new NodeRepository(ctx);
|
||||
PresentsServer.registerShutdowner(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the distributed object that represents this node to its peers.
|
||||
*/
|
||||
@@ -153,6 +142,8 @@ public class PeerManager
|
||||
* bits, so this should not be called until <em>after</em> the main server has set up its
|
||||
* client factory and authenticator.
|
||||
*
|
||||
* @param ctx used to communicate with the database.
|
||||
* @param invoker we will perform all database operations on the supplied invoker thread.
|
||||
* @param nodeName this node's unique name.
|
||||
* @param sharedSecret a shared secret used to allow the peers to authenticate with one
|
||||
* another.
|
||||
@@ -161,16 +152,17 @@ public class PeerManager
|
||||
* known to normal clients (we may want inter-peer communication to take place over a different
|
||||
* network than the communication between real clients and the various peer servers).
|
||||
* @param port the port on which other nodes should connect to us.
|
||||
* @param conprov used to obtain our JDBC connections.
|
||||
* @param invoker we will perform all database operations on the supplied invoker thread.
|
||||
*/
|
||||
public void init (String nodeName, String sharedSecret, String hostName,
|
||||
String publicHostName, int port)
|
||||
public void init (PersistenceContext ctx, Invoker invoker, String nodeName,
|
||||
String sharedSecret, String hostName, String publicHostName, int port)
|
||||
{
|
||||
_invoker = invoker;
|
||||
_noderepo = new NodeRepository(ctx);
|
||||
_nodeName = nodeName;
|
||||
_sharedSecret = sharedSecret;
|
||||
|
||||
// wire ourselves into the server
|
||||
PresentsServer.registerShutdowner(this);
|
||||
PresentsServer.conmgr.setAuthenticator(
|
||||
new PeerAuthenticator(this, PresentsServer.conmgr.getAuthenticator()));
|
||||
PresentsServer.clmgr.setClientFactory(
|
||||
|
||||
Reference in New Issue
Block a user