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
@@ -26,7 +26,6 @@ import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.samskivert.util.ResultListener;
import com.threerings.presents.annotation.MainInvoker;
import com.threerings.presents.data.AuthCodes;
import com.threerings.presents.net.AuthRequest;
@@ -34,8 +33,6 @@ import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.net.AuthingConnection;
import com.threerings.presents.server.net.ConnectionManager;
import static com.threerings.presents.Log.log;
/**
@@ -57,6 +54,7 @@ public abstract class Authenticator
final AuthResponse rsp = new AuthResponse(rdata);
invoker.postUnit(new Invoker.Unit("authenticateConnection") {
@Override
public boolean invoke() {
try {
processAuthentication(conn, rsp);
@@ -67,6 +65,7 @@ public abstract class Authenticator
return true;
}
@Override
public void handleResult () {
// stuff a reference to the auth response into the connection so that we have
// access to it later in the authentication process
@@ -23,7 +23,6 @@ package com.threerings.presents.server;
import com.threerings.util.Name;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.net.AuthRequest;
/**
@@ -107,6 +107,7 @@ public class ClientManager
// start up an interval that will check for expired clients and flush them from the bowels
// of the server
new Interval(_omgr) {
@Override
public void expired () {
flushClients();
}
@@ -32,8 +32,6 @@ import com.threerings.util.Name;
import com.threerings.presents.annotation.MainInvoker;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.PermissionPolicy;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.dobj.RootDObjectManager;
import static com.threerings.presents.Log.log;
@@ -92,7 +90,7 @@ public class ClientResolver extends Invoker.Unit
_invoker.postUnit(this);
}
// documentation inherited
@Override
public boolean invoke ()
{
try {
@@ -105,7 +103,7 @@ public class ClientResolver extends Invoker.Unit
return true;
}
// documentation inherited
@Override
public void handleResult ()
{
// if we haven't failed, finish resolution on the dobj thread
@@ -140,7 +138,7 @@ public class ClientResolver extends Invoker.Unit
}
}
// documentation inherited
@Override
public String toString ()
{
return "ClientResolver:" + _username;
@@ -23,8 +23,6 @@ package com.threerings.presents.server;
import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.net.AuthingConnection;
@@ -36,7 +34,7 @@ import static com.threerings.presents.Log.log;
*/
public class DummyAuthenticator extends Authenticator
{
// from abstract Authenticator
@Override
protected void processAuthentication (AuthingConnection conn, AuthResponse rsp)
throws PersistenceException
{
@@ -43,8 +43,6 @@ import com.threerings.presents.dobj.DEvent;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.EventListener;
import com.threerings.presents.dobj.InvocationRequestEvent;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.net.Transport;
import static com.threerings.presents.Log.log;
@@ -75,13 +75,13 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
};
}
// documentation inherited
@Override
public synchronized boolean isDispatchThread ()
{
return EventQueue.isDispatchThread();
}
// documentation inherited
@Override
public void postEvent (final DEvent event)
{
EventQueue.invokeLater(new Runnable() {
@@ -91,7 +91,7 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
});
}
// documentation inherited
@Override
public void postRunnable (Runnable unit)
{
// we just pass this right on to the AWT event queue rather than running them through
@@ -51,6 +51,7 @@ public class NativeSignalHandler extends AbstractSignalHandler
return true;
}
@Override
protected boolean registerHandlers ()
{
if (!SignalManager.servicesAvailable()) {
@@ -807,9 +807,7 @@ public class PresentsClient
return false;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder("[");
@@ -29,7 +29,6 @@ import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.samskivert.util.AuditLogger;
import com.samskivert.util.Histogram;
import com.samskivert.util.IntMap;
import com.samskivert.util.IntMaps;
@@ -845,11 +844,13 @@ public class PresentsDObjectMgr
_action = action;
}
@Override
public boolean isPrivate ()
{
return true;
}
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -930,6 +931,7 @@ public class PresentsDObjectMgr
return (this.reffingOid == reffingOid && this.field.equals(field));
}
@Override
public String toString ()
{
return "[reffingOid=" + reffingOid + ", field=" + field +
@@ -947,6 +949,7 @@ public class PresentsDObjectMgr
_histo.addValue((int)elapsed);
}
@Override
public String toString ()
{
int count = _histo.size();
@@ -21,8 +21,6 @@
package com.threerings.presents.server;
import java.util.Iterator;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -134,6 +132,7 @@ public class PresentsInvoker extends Invoker
protected class ShutdownUnit extends Unit
{
// run on the invoker thread
@Override
public boolean invoke ()
{
if (checkLoops()) {
@@ -154,6 +153,7 @@ public class PresentsInvoker extends Invoker
}
// run on the dobj thread
@Override
public void handleResult ()
{
if (checkLoops()) {
@@ -206,6 +206,7 @@ public class PresentsInvoker extends Invoker
// end the invoker thread
postUnit(new Unit() {
@Override
public boolean invoke () {
_running = false;
return false;
@@ -148,6 +148,7 @@ public abstract class RebootManager
_rebootSoon = false;
long firstWarnTime = (_nextReboot - (WARNINGS[0] * 60 * 1000)) - now;
_interval = new Interval(_omgr) {
@Override
public void expired () {
doWarning(0);
}
@@ -238,6 +239,7 @@ public abstract class RebootManager
// wait 1 second, then do it
new Interval() { // Note: This interval does not run on the dobj thread
@Override
public void expired () {
// ...but we then post a LongRunnable...
_omgr.postRunnable(new PresentsDObjectMgr.LongRunnable() {
@@ -265,6 +267,7 @@ public abstract class RebootManager
// schedule the next warning
_interval = new Interval(_omgr) {
@Override
public void expired () {
doWarning(level + 1);
}
@@ -287,6 +290,7 @@ public abstract class RebootManager
StringUtil.toString(_rebootLocks.elements()));
broadcast("m.reboot_delayed");
_interval = new Interval(_omgr) {
@Override
public void expired () {
doWarning(WARNINGS.length);
}
@@ -26,12 +26,10 @@ import com.google.inject.Injector;
import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.samskivert.util.StringUtil;
import com.threerings.util.MessageBundle;
import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.net.AuthingConnection;
import static com.threerings.presents.Log.log;
@@ -51,7 +49,7 @@ public class Rejector extends PresentsServer
}
}
// documentation inherited
@Override
protected int[] getListenPorts ()
{
return _ports;
@@ -87,7 +85,7 @@ public class Rejector extends PresentsServer
*/
protected class RejectingAuthenticator extends Authenticator
{
// from abstract Authenticator
@Override
protected void processAuthentication (AuthingConnection conn, AuthResponse rsp)
throws PersistenceException
{
@@ -30,8 +30,6 @@ import com.samskivert.util.Interval;
import com.samskivert.util.RunQueue;
import com.samskivert.util.StringUtil;
import com.threerings.presents.annotation.EventQueue;
import static com.threerings.presents.Log.log;
/**
@@ -62,6 +60,7 @@ public class ReportManager
{
// queue up an interval which will generate reports
_reportInterval = new Interval(rqueue) {
@Override
public void expired () {
logReport(generateReport(System.currentTimeMillis(), true));
}
@@ -24,13 +24,12 @@ package com.threerings.presents.server;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.SignalUtil;
import static com.threerings.presents.Log.log;
/**
* Handles signals using Sun's undocumented Signal class.
*/
public class SunSignalHandler extends AbstractSignalHandler
{
@Override
protected boolean registerHandlers ()
{
SignalUtil.register(SignalUtil.Number.TERM, new SignalUtil.Handler() {
@@ -22,8 +22,6 @@
package com.threerings.presents.server;
import java.util.HashMap;
import com.samskivert.util.ResultListener;
import com.threerings.presents.client.TimeBaseService.GotTimeBaseListener;
import com.threerings.presents.data.ClientObject;
@@ -32,8 +30,6 @@ import com.threerings.presents.data.TimeBaseObject;
import com.threerings.presents.dobj.RootDObjectManager;
import static com.threerings.presents.Log.log;
/**
* Provides the server-side of the time base services. The time base services provide a means by
* which delta times can be sent over the network which are expanded based on a shared base time
@@ -101,9 +101,7 @@ public class AuthingConnection extends Connection
_authrsp = authrsp;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[mode=AUTHING, addr=" +
@@ -36,7 +36,6 @@ import java.security.NoSuchAlgorithmException;
import com.samskivert.util.StringUtil;
import com.threerings.io.ByteBufferInputStream;
import com.threerings.io.ByteBufferOutputStream;
import com.threerings.io.FramedInputStream;
import com.threerings.io.FramingOutputStream;
import com.threerings.io.ObjectInputStream;
@@ -24,7 +24,6 @@ package com.threerings.presents.server.net;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
@@ -52,7 +51,6 @@ import com.samskivert.util.Invoker;
import com.samskivert.util.LoopingThread;
import com.samskivert.util.Queue;
import com.samskivert.util.ResultListener;
import com.samskivert.util.StringUtil;
import com.samskivert.util.Tuple;
import com.threerings.io.FramingOutputStream;
@@ -281,7 +279,7 @@ public class ConnectionManager extends LoopingThread
}
}
// documentation inherited
@Override
protected void willStart ()
{
int successes = 0;
@@ -414,6 +412,7 @@ public class ConnectionManager extends LoopingThread
/**
* Performs the select loop. This is the body of the conmgr thread.
*/
@Override
protected void iterate ()
{
long iterStamp = System.currentTimeMillis();
@@ -708,14 +707,14 @@ public class ConnectionManager extends LoopingThread
_stats.bytesOut += bytes;
}
// documentation inherited
@Override
protected void handleIterateFailure (Exception e)
{
// log the exception
log.warning("ConnectionManager.iterate() uncaught exception.", e);
}
// documentation inherited
@Override
protected void didShutdown ()
{
// take one last crack at the outgoing message queue
@@ -1026,9 +1025,7 @@ public class ConnectionManager extends LoopingThread
_partial.flip();
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
return "[conn=" + conn + ", partials=" + _partials + ", msgs=" + _msgs + "]";
@@ -51,6 +51,7 @@ public class RunningConnection extends Connection
{
}
@Override
public String toString ()
{
return "[mode=RUNNING, id=" + (hashCode() % 1000) +