And finally, narya gets the imports/overrides/regen love.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5241 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Dave Hoover
2008-07-18 23:20:17 +00:00
parent e41dda3018
commit 6b1d65553f
129 changed files with 383 additions and 304 deletions
@@ -28,7 +28,6 @@ import com.threerings.presents.data.AuthCodes;
import com.threerings.presents.net.AuthRequest;
import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.Authenticator;
import com.threerings.presents.server.ChainedAuthenticator;
import com.threerings.presents.server.net.AuthingConnection;
@@ -52,6 +52,7 @@ public class PeerClient extends PresentsClient
* bootstrap data classes that contain extra bootstrap information, if
* desired.
*/
@Override
protected BootstrapData createBootstrapData ()
{
return new PeerBootstrapData();
@@ -67,6 +68,7 @@ public class PeerClient extends PresentsClient
* thread which means that object manipulations are OK, but client
* instance manipulations must be done carefully.
*/
@Override
protected void populateBootstrapData (BootstrapData data)
{
super.populateBootstrapData(data);
@@ -220,6 +220,7 @@ public abstract class PeerManager
_self = new NodeRecord(
_nodeName, hostName, (publicHostName == null) ? hostName : publicHostName, port);
_invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") {
@Override
public void invokePersist () throws Exception {
_noderepo.updateNode(_self);
}
@@ -701,6 +702,7 @@ public abstract class PeerManager
// clear our record from the node table
_invoker.postUnit(new WriteOnlyUnit("deleteNode(" + _nodeName + ")") {
@Override
public void invokePersist () throws Exception {
_noderepo.deleteNode(_nodeName);
}
@@ -797,12 +799,14 @@ public abstract class PeerManager
{
// load up information on our nodes
_invoker.postUnit(new RepositoryUnit("refreshPeers") {
@Override
public void invokePersist () throws Exception {
// let the world know that we're alive
_noderepo.heartbeatNode(_nodeName);
// then load up all the peer records
_nodes = _noderepo.loadNodes();
}
@Override
public void handleSuccess() {
for (NodeRecord record : _nodes) {
if (record.nodeName.equals(_nodeName)) {
@@ -815,6 +819,7 @@ public abstract class PeerManager
}
}
}
@Override
public long getLongThreshold () {
return 700L;
}
@@ -1011,6 +1016,7 @@ public abstract class PeerManager
// schedule a timeout to act if something goes wrong
(_timeout = new Interval(_omgr) {
@Override
public void expired () {
log.warning("Lock handler timed out, acting anyway [lock=" + _lock +
", acquire=" + _acquire + "].");
@@ -1187,6 +1193,7 @@ public abstract class PeerManager
// (this need not use a runqueue as all it will do is post an invoker unit)
protected Interval _peerRefresher = new Interval() {
@Override
public void expired () {
refreshPeers();
}
@@ -60,6 +60,7 @@ public class PeerNode
_omgr = omgr;
_record = record;
_client = new Client(null, _omgr) {
@Override
protected void convertFromRemote (DObject target, DEvent event) {
super.convertFromRemote(target, event);
// rewrite the event's target oid using the oid currently configured on the
@@ -70,6 +71,7 @@ public class PeerNode
// properly deal with it
event.eventId = PeerNode.this._omgr.getNextEventId(true);
}
@Override
protected Communicator createCommunicator () {
// TODO: make a custom communicator that uses the ClientManager NIO system to do
// its I/O instead of using two threads and blocking socket I/O
@@ -119,9 +119,7 @@ public class NodeRecord extends PersistentRecord
this.nodeName = nodeName;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return StringUtil.fieldsToString(this);