Create our PeerNode object through injection.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5714 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-04-11 01:12:16 +00:00
parent 18d36176a3
commit 24760fa266
2 changed files with 6 additions and 3 deletions
@@ -875,7 +875,8 @@ public abstract class PeerManager
{
PeerNode peer = _peers.get(record.nodeName);
if (peer == null) {
_peers.put(record.nodeName, peer = createPeerNode());
peer = _injector.getInstance(getPeerNodeClass());
_peers.put(record.nodeName, peer);
peer.init(this, _omgr, _conmgr, record);
}
peer.refresh(record);
@@ -978,9 +979,9 @@ public abstract class PeerManager
/**
* Creates a {@link PeerNode} to manage our connection to the specified peer.
*/
protected PeerNode createPeerNode ()
protected Class<? extends PeerNode> getPeerNodeClass ()
{
return new PeerNode();
return PeerNode.class;
}
/**
@@ -25,6 +25,8 @@ import java.net.ConnectException;
import java.util.Date;
import com.google.inject.Inject;
import com.samskivert.util.ResultListenerList;
import com.threerings.presents.client.BlockingCommunicator;