Don't save the NodeRecord if our nodeName is null.

This is to support running in ad-hoc, single-node noded mode.
However, it appears some code in here will choke on a null
node name.

This is for something in Spiral Knights, where we used to run
in non-noded or noded mode, and so we already cope with the
nodeName being null. Now we want to always run noded, so that
we can DRY and not check various local variables before checking
the (other) NodeObjects: now we can just check against all
the node objects.

So I may need to return here and make safe various equality
checks against the nodeName.
This commit is contained in:
Ray J. Greenwell
2012-08-01 18:44:49 -07:00
parent 2a0acc28ba
commit 829139b1e7
@@ -343,12 +343,14 @@ public abstract class PeerManager
_self = new NodeRecord(
_nodeName, hostName, (publicHostName == null) ? hostName : publicHostName,
region, port);
_invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") {
@Override
public void invokePersist () throws Exception {
_noderepo.updateNode(_self);
}
});
if (_nodeName != null) {
_invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") {
@Override
public void invokePersist () throws Exception {
_noderepo.updateNode(_self);
}
});
}
// set the invocation service
_nodeobj.setPeerService(_invmgr.registerProvider(this, PeerMarshaller.class));