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:
@@ -875,7 +875,8 @@ public abstract class PeerManager
|
|||||||
{
|
{
|
||||||
PeerNode peer = _peers.get(record.nodeName);
|
PeerNode peer = _peers.get(record.nodeName);
|
||||||
if (peer == null) {
|
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.init(this, _omgr, _conmgr, record);
|
||||||
}
|
}
|
||||||
peer.refresh(record);
|
peer.refresh(record);
|
||||||
@@ -978,9 +979,9 @@ public abstract class PeerManager
|
|||||||
/**
|
/**
|
||||||
* Creates a {@link PeerNode} to manage our connection to the specified peer.
|
* 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 java.util.Date;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
import com.samskivert.util.ResultListenerList;
|
import com.samskivert.util.ResultListenerList;
|
||||||
|
|
||||||
import com.threerings.presents.client.BlockingCommunicator;
|
import com.threerings.presents.client.BlockingCommunicator;
|
||||||
|
|||||||
Reference in New Issue
Block a user