Publish our server startup time in our NodeObject.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5867 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -38,6 +38,9 @@ public class NodeObject extends DObject
|
|||||||
/** The field name of the <code>nodeName</code> field. */
|
/** The field name of the <code>nodeName</code> field. */
|
||||||
public static final String NODE_NAME = "nodeName";
|
public static final String NODE_NAME = "nodeName";
|
||||||
|
|
||||||
|
/** The field name of the <code>bootStamp</code> field. */
|
||||||
|
public static final String BOOT_STAMP = "bootStamp";
|
||||||
|
|
||||||
/** The field name of the <code>peerService</code> field. */
|
/** The field name of the <code>peerService</code> field. */
|
||||||
public static final String PEER_SERVICE = "peerService";
|
public static final String PEER_SERVICE = "peerService";
|
||||||
|
|
||||||
@@ -130,6 +133,9 @@ public class NodeObject extends DObject
|
|||||||
/** The node name of this peer. */
|
/** The node name of this peer. */
|
||||||
public String nodeName;
|
public String nodeName;
|
||||||
|
|
||||||
|
/** The time that this node's JVM started up. */
|
||||||
|
public long bootStamp;
|
||||||
|
|
||||||
/** The service used to make requests of the node. */
|
/** The service used to make requests of the node. */
|
||||||
public PeerMarshaller peerService;
|
public PeerMarshaller peerService;
|
||||||
|
|
||||||
@@ -165,6 +171,22 @@ public class NodeObject extends DObject
|
|||||||
this.nodeName = value;
|
this.nodeName = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests that the <code>bootStamp</code> field be set to the
|
||||||
|
* specified value. The local value will be updated immediately and an
|
||||||
|
* event will be propagated through the system to notify all listeners
|
||||||
|
* that the attribute did change. Proxied copies of this object (on
|
||||||
|
* clients) will apply the value change when they received the
|
||||||
|
* attribute changed notification.
|
||||||
|
*/
|
||||||
|
public void setBootStamp (long value)
|
||||||
|
{
|
||||||
|
long ovalue = this.bootStamp;
|
||||||
|
requestAttributeChange(
|
||||||
|
BOOT_STAMP, Long.valueOf(value), Long.valueOf(ovalue));
|
||||||
|
this.bootStamp = value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that the <code>peerService</code> field be set to the
|
* Requests that the <code>peerService</code> field be set to the
|
||||||
* specified value. The local value will be updated immediately and an
|
* specified value. The local value will be updated immediately and an
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ public abstract class PeerManager
|
|||||||
// create our node object
|
// create our node object
|
||||||
_nodeobj = _omgr.registerObject(createNodeObject());
|
_nodeobj = _omgr.registerObject(createNodeObject());
|
||||||
_nodeobj.setNodeName(nodeName);
|
_nodeobj.setNodeName(nodeName);
|
||||||
|
_nodeobj.setBootStamp(System.currentTimeMillis());
|
||||||
|
|
||||||
// register ourselves with the node table
|
// register ourselves with the node table
|
||||||
_self = new NodeRecord(
|
_self = new NodeRecord(
|
||||||
|
|||||||
Reference in New Issue
Block a user