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
@@ -540,6 +540,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_Reader");
}
@Override
protected void willStart ()
{
// first we connect and authenticate with the server
@@ -609,6 +610,7 @@ public class BlockingCommunicator extends Communicator
// now that we're authenticated, we manage the reading half of things by continuously
// reading messages from the socket and processing them
@Override
protected void iterate ()
{
DownstreamMessage msg = null;
@@ -642,17 +644,20 @@ public class BlockingCommunicator extends Communicator
}
}
@Override
protected void handleIterateFailure (Exception e)
{
log.warning("Uncaught exception it reader thread.", e);
}
@Override
protected void didShutdown ()
{
// let the communicator know when we finally go away
readerDidExit();
}
@Override
protected void kick ()
{
// we want to interrupt the reader thread as it may be blocked listening to the socket;
@@ -677,6 +682,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_Writer");
}
@Override
protected void iterate ()
{
// fetch the next message from the queue
@@ -700,16 +706,19 @@ public class BlockingCommunicator extends Communicator
}
}
@Override
protected void handleIterateFailure (Exception e)
{
log.warning("Uncaught exception it writer thread.", e);
}
@Override
protected void didShutdown ()
{
writerDidExit();
}
@Override
protected void kick ()
{
// post a bogus message to the outgoing queue to ensure that the writer thread notices
@@ -728,6 +737,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_DatagramReader");
}
@Override
protected void willStart ()
{
try {
@@ -823,6 +833,7 @@ public class BlockingCommunicator extends Communicator
return false;
}
@Override
protected void iterate ()
{
DownstreamMessage msg = null;
@@ -849,16 +860,19 @@ public class BlockingCommunicator extends Communicator
}
}
@Override
protected void handleIterateFailure (Exception e)
{
log.warning("Uncaught exception in datagram reader thread.", e);
}
@Override
protected void didShutdown ()
{
datagramReaderDidExit();
}
@Override
protected void kick ()
{
// if we have a selector, wake it up
@@ -878,6 +892,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_DatagramWriter");
}
@Override
protected void iterate ()
{
// fetch the next message from the queue
@@ -898,16 +913,19 @@ public class BlockingCommunicator extends Communicator
}
}
@Override
protected void handleIterateFailure (Exception e)
{
log.warning("Uncaught exception in datagram writer thread.", e);
}
@Override
protected void didShutdown ()
{
datagramWriterDidExit();
}
@Override
protected void kick ()
{
// post a bogus message to the outgoing queue to ensure that the writer thread notices
@@ -425,9 +425,11 @@ public class Client
// appropriate
if (_tickInterval == null) {
_tickInterval = new Interval(_runQueue) {
@Override
public void expired () {
tick();
}
@Override
public String toString () {
return "Client.tickInterval";
}
@@ -897,6 +899,7 @@ public class Client
}
}
@Override
public void clientDidClear (Client client)
{
// configure the client to point to the new server and logon
@@ -910,6 +913,7 @@ public class Client
}
}
@Override
public void clientDidLogon (Client client)
{
removeClientObserver(this);
@@ -918,6 +922,7 @@ public class Client
}
}
@Override
public void clientFailedToLogon (Client client, Exception cause)
{
removeClientObserver(this);
@@ -144,6 +144,7 @@ public class ClientCommunicator extends BlockingCommunicator
_nextPort = nextPort;
}
@Override
public void expired () {
if (clearPPI(false)) {
setPrefPort(_key, _thisPort);
@@ -66,6 +66,7 @@ public class ClientDObjectMgr
// register a flush interval
new Interval(client.getRunQueue()) {
@Override
public void expired () {
flushObjects();
}
@@ -440,6 +441,7 @@ public class ClientDObjectMgr
this.subscribe = subscribe;
}
@Override
public String toString ()
{
return StringUtil.fieldsToString(this);
@@ -79,7 +79,7 @@ public interface InvocationReceiver
return receiverCode;
}
/** Generates a string representation of this instance. */
@Override
public String toString ()
{
return "[" + receiverCode + " => " + receiverId + "]";
@@ -26,8 +26,6 @@ import com.samskivert.util.StringUtil;
import com.threerings.io.Streamable;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService.ConfirmListener;
import com.threerings.presents.client.InvocationService.ResultListener;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.dobj.DObjectManager;
@@ -116,16 +114,14 @@ public class InvocationMarshaller
}
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[callerOid=" + callerOid + ", reqId=" + requestId +
", type=" + getClass().getName() + "]";
}
// documentation inherited
@Override
protected void finalize ()
throws Throwable
{
@@ -156,7 +152,7 @@ public class InvocationMarshaller
callerOid, requestId, REQUEST_PROCESSED, null, transport));
}
// documentation inherited
@Override
public void dispatchResponse (int methodId, Object[] args)
{
switch (methodId) {
@@ -187,7 +183,7 @@ public class InvocationMarshaller
callerOid, requestId, REQUEST_PROCESSED, new Object[] { result }, transport));
}
// documentation inherited
@Override
public void dispatchResponse (int methodId, Object[] args)
{
switch (methodId) {
@@ -240,9 +236,7 @@ public class InvocationMarshaller
}
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[invOid=" + _invOid + ", code=" + _invCode + ", type=" + getClass().getName() + "]";
@@ -114,7 +114,7 @@ public class AttributeChangedEvent extends NamedEvent
return ((Double)_value).doubleValue();
}
@Override // from DEvent
@Override
public boolean alreadyApplied ()
{
// if we have an old value, that means we're running on the master server and we have
@@ -122,7 +122,7 @@ public class AttributeChangedEvent extends NamedEvent
return (_oldValue != UNSET_OLD_VALUE);
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -184,7 +184,7 @@ public class AttributeChangedEvent extends NamedEvent
_oldValue = oldValue;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof AttributeChangeListener) {
@@ -192,7 +192,7 @@ public class AttributeChangedEvent extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("CHANGE:");
@@ -122,7 +122,7 @@ public class CompoundEvent extends DEvent
_events.clear();
}
@Override // from DEvent
@Override
public void setSourceOid (int sourceOid)
{
super.setSourceOid(sourceOid);
@@ -134,7 +134,7 @@ public class CompoundEvent extends DEvent
}
}
@Override // from DEvent
@Override
public void setTargetOid (int targetOid)
{
super.setTargetOid(targetOid);
@@ -146,7 +146,7 @@ public class CompoundEvent extends DEvent
}
}
@Override // from DEvent
@Override
public void setTransport (Transport transport)
{
super.setTransport(transport);
@@ -155,7 +155,7 @@ public class CompoundEvent extends DEvent
}
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -174,7 +174,7 @@ public class CompoundEvent extends DEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("COMPOUND:");
@@ -162,9 +162,7 @@ public abstract class DEvent implements Streamable
// the default is to do nothing
}
/**
* Constructs and returns a string representation of this event.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder();
@@ -409,14 +409,13 @@ public class DSet<E extends DSet.Entry>
/**
* Generates a shallow copy of this object.
*/
@Override
public Object clone ()
{
return typedClone();
}
/**
* Generates a string representation of this set instance.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder("(");
@@ -153,13 +153,13 @@ public class ElementUpdatedEvent extends NamedEvent
return ((Double)_value).doubleValue();
}
@Override // from DEvent
@Override
public boolean alreadyApplied ()
{
return (_oldValue != UNSET_OLD_VALUE);
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -191,7 +191,7 @@ public class ElementUpdatedEvent extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof ElementUpdateListener) {
@@ -199,7 +199,7 @@ public class ElementUpdatedEvent extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("UPDATE:");
@@ -71,13 +71,13 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
return _entry;
}
@Override // from DEvent
@Override
public boolean alreadyApplied ()
{
return _alreadyApplied;
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -89,7 +89,7 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof SetListener) {
@@ -98,7 +98,7 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("ELADD:");
@@ -72,13 +72,13 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
return _oldEntry;
}
@Override // from DEvent
@Override
public boolean alreadyApplied ()
{
return (_oldEntry != UNSET_OLD_ENTRY);
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -95,7 +95,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof SetListener) {
@@ -104,7 +104,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("ELREM:");
@@ -90,13 +90,13 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
return _oldEntry;
}
@Override // from DEvent
@Override
public boolean alreadyApplied ()
{
return (_oldEntry != UNSET_OLD_ENTRY);
}
@Override // from DEvent
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -114,7 +114,7 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof SetListener) {
@@ -123,7 +123,7 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("ELUPD:");
@@ -107,9 +107,7 @@ public class InvocationNotificationEvent extends DEvent
return _args;
}
/**
* Applies this attribute change to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -117,13 +115,13 @@ public class InvocationNotificationEvent extends DEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
// nothing to do here
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("INOT:");
@@ -102,9 +102,7 @@ public class InvocationRequestEvent extends DEvent
return _args;
}
/**
* Applies this attribute change to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -112,13 +110,13 @@ public class InvocationRequestEvent extends DEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
// nothing to do here
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("IREQ:");
@@ -102,9 +102,7 @@ public class InvocationResponseEvent extends DEvent
return _args;
}
/**
* Applies this attribute change to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -112,13 +110,13 @@ public class InvocationResponseEvent extends DEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
// nothing to do here
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("IRSP:");
@@ -94,9 +94,7 @@ public class MessageEvent extends NamedEvent
_args = args;
}
/**
* Applies this attribute change to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -104,7 +102,7 @@ public class MessageEvent extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof MessageListener) {
@@ -112,7 +110,7 @@ public class MessageEvent extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("MSG:");
@@ -71,6 +71,7 @@ public abstract class NamedEvent extends DEvent
return _name;
}
@Override
protected void toString (StringBuilder buf)
{
super.toString(buf);
@@ -63,9 +63,7 @@ public class ObjectAddedEvent extends NamedEvent
return _oid;
}
/**
* Applies this event to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -74,7 +72,7 @@ public class ObjectAddedEvent extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof OidListListener) {
@@ -82,7 +80,7 @@ public class ObjectAddedEvent extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("OBJADD:");
@@ -49,7 +49,7 @@ public class ObjectDestroyedEvent extends DEvent
{
}
// documentation inherited
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -58,7 +58,7 @@ public class ObjectDestroyedEvent extends DEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof ObjectDeathListener) {
@@ -66,7 +66,7 @@ public class ObjectDestroyedEvent extends DEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("DESTROY:");
@@ -64,9 +64,7 @@ public class ObjectRemovedEvent extends NamedEvent
return _oid;
}
/**
* Applies this event to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -75,7 +73,7 @@ public class ObjectRemovedEvent extends NamedEvent
return true;
}
// documentation inherited
@Override
protected void notifyListener (Object listener)
{
if (listener instanceof OidListListener) {
@@ -83,7 +81,7 @@ public class ObjectRemovedEvent extends NamedEvent
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
buf.append("OBJREM:");
@@ -133,6 +133,7 @@ public class OidList implements Streamable
return _oids[index];
}
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder();
@@ -54,7 +54,7 @@ public class ReleaseLockEvent extends NamedEvent
{
}
// documentation inherited
@Override
public boolean isPrivate ()
{
// we need only run on the server; no need to propagate to proxies
@@ -64,6 +64,7 @@ public class ReleaseLockEvent extends NamedEvent
/**
* Applies this lock release to the object.
*/
@Override
public boolean applyToObject (DObject target)
throws ObjectAccessException
{
@@ -73,6 +74,7 @@ public class ReleaseLockEvent extends NamedEvent
return false;
}
@Override
protected void toString (StringBuilder buf)
{
buf.append("UNLOCK:");
@@ -82,9 +82,7 @@ public class AuthRequest extends UpstreamMessage
return _bootGroups;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[type=AREQ, msgid=" + messageId + ", creds=" + _creds +
@@ -66,6 +66,7 @@ public class AuthResponse extends DownstreamMessage
_data = data;
}
@Override
public String toString ()
{
return "[type=ARSP, msgid=" + messageId + ", data=" + _data + "]";
@@ -52,6 +52,7 @@ public class BootstrapNotification extends DownstreamMessage
return _data;
}
@Override
public String toString ()
{
return "[type=BOOT, msgid=" + messageId + ", data=" + _data + "]";
@@ -71,13 +71,13 @@ public abstract class Credentials implements Streamable
return "";
}
// documentation inherited
@Override
public int hashCode ()
{
return _username.hashCode();
}
// documentation inherited
@Override
public boolean equals (Object other)
{
if (other instanceof Credentials) {
@@ -87,9 +87,7 @@ public abstract class Credentials implements Streamable
}
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder("[");
@@ -35,9 +35,7 @@ public abstract class DownstreamMessage extends Message
*/
public short messageId = -1;
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[msgid=" + messageId + "]";
@@ -59,6 +59,7 @@ public class EventNotification extends DownstreamMessage
return _event.getTransport();
}
@Override
public String toString ()
{
return "[type=EVT, evt=" + _event + "]";
@@ -50,6 +50,7 @@ public class FailureResponse extends DownstreamMessage
return _message;
}
@Override
public String toString ()
{
return "[type=FAIL, msgid=" + messageId + ", oid=" + _oid + ", msg=" + _message + "]";
@@ -62,6 +62,7 @@ public class ForwardEventRequest extends UpstreamMessage
return _event.getTransport();
}
@Override
public String toString ()
{
return "[type=FWD, evt=" + _event + "]";
@@ -31,6 +31,7 @@ public class LogoffRequest extends UpstreamMessage
super();
}
@Override
public String toString ()
{
return "[type=LOGOFF, msgid=" + messageId + "]";
@@ -47,6 +47,7 @@ public class ObjectResponse<T extends DObject>
return _dobj;
}
@Override
public String toString ()
{
return "[type=ORSP, msgid=" + messageId + ", obj=" + _dobj + "]";
@@ -105,6 +105,7 @@ public class PingRequest extends UpstreamMessage
return _transport;
}
@Override
public String toString ()
{
return "[type=PING, msgid=" + messageId + ", transport=" + _transport + "]";
@@ -125,6 +125,7 @@ public class PongResponse extends DownstreamMessage
return _transport;
}
@Override
public String toString ()
{
return "[type=PONG, msgid=" + messageId + ", transport=" + _transport + "]";
@@ -48,6 +48,7 @@ public class SubscribeRequest extends UpstreamMessage
return _oid;
}
@Override
public String toString ()
{
return "[type=SUB, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -40,6 +40,7 @@ public class Transport
* and without duplicates. Functionally identical to UDP.
*/
UNRELIABLE_UNORDERED(false, false) {
@Override
public Type combine (Type other) {
return other; // we defer to all
}
@@ -50,6 +51,7 @@ public class Transport
* order and without duplicates. In other words, out-of-order packets will be dropped.
*/
UNRELIABLE_ORDERED(false, true) {
@Override
public Type combine (Type other) {
return other.isReliable() ? RELIABLE_ORDERED : this;
}
@@ -60,6 +62,7 @@ public class Transport
* order.
*/
RELIABLE_UNORDERED(true, false) {
@Override
public Type combine (Type other) {
return other.isOrdered() ? RELIABLE_ORDERED : this;
}
@@ -70,6 +73,7 @@ public class Transport
* Functionally identical to TCP.
*/
RELIABLE_ORDERED(true, true) {
@Override
public Type combine (Type other) {
return this; // we override all
}
@@ -48,6 +48,7 @@ public class UnsubscribeRequest extends UpstreamMessage
return _oid;
}
@Override
public String toString ()
{
return "[type=UNSUB, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -49,6 +49,7 @@ public class UnsubscribeResponse extends DownstreamMessage
return _oid;
}
@Override
public String toString ()
{
return "[type=UNACK, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -52,6 +52,7 @@ public abstract class UpstreamMessage extends Message
this.messageId = nextMessageId();
}
@Override
public String toString ()
{
return "[msgid=" + messageId + "]";
@@ -47,19 +47,19 @@ public class UsernamePasswordCreds extends Credentials
return _password;
}
@Override // documentation inherited
@Override
public String getDatagramSecret ()
{
return _password;
}
// documentation inherited
@Override
public int hashCode ()
{
return super.hashCode() ^ _password.hashCode();
}
// documentation inherited
@Override
public boolean equals (Object other)
{
if (other instanceof UsernamePasswordCreds) {
@@ -71,7 +71,7 @@ public class UsernamePasswordCreds extends Credentials
}
}
// documentation inherited
@Override
protected void toString (StringBuilder buf)
{
super.toString(buf);
@@ -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);
@@ -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) +
@@ -975,6 +975,7 @@ public class ActionScriptSource
writer.flush();
}
@Override
public String toString ()
{
StringBuilder builder = new StringBuilder();
@@ -31,14 +31,10 @@ import java.util.Date;
import java.util.Map;
import java.util.Properties;
import com.samskivert.util.StringUtil;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.util.ClasspathUtils;
/**
* Generates our own ResourceBundle classes.
@@ -58,6 +54,7 @@ public class GenActionScriptBundlesTask extends Task
_asroot = asroot;
}
@Override
public void execute ()
throws BuildException
{
@@ -21,16 +21,12 @@
package com.threerings.presents.tools;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -40,15 +36,10 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.util.ClasspathUtils;
import org.apache.commons.io.IOUtils;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import com.samskivert.util.StringUtil;
import com.samskivert.velocity.VelocityUtil;
import com.threerings.io.Streamable;
@@ -94,6 +85,7 @@ public class GenActionScriptTask extends Task
/**
* Performs the actual work of the task.
*/
@Override
public void execute () throws BuildException
{
try {
@@ -21,11 +21,7 @@
package com.threerings.presents.tools;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
@@ -35,15 +31,6 @@ import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.tools.ant.AntClassLoader;
@@ -57,14 +44,10 @@ import org.apache.tools.ant.util.ClasspathUtils;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import com.samskivert.util.ObjectUtil;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.StringUtil;
import com.samskivert.velocity.VelocityUtil;
import com.threerings.presents.annotation.TransportHint;
import com.threerings.presents.net.Transport;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.DSet;
import com.threerings.presents.dobj.OidList;
@@ -96,7 +79,7 @@ public class GenDObjectTask extends Task
((AntClassLoader)_cloader).setParent(getClass().getClassLoader());
}
/** Performs the actual work of the task. */
@Override
public void execute () throws BuildException
{
if (_cloader == null) {
@@ -46,7 +46,7 @@ import com.threerings.presents.server.InvocationSender;
*/
public class GenReceiverTask extends InvocationTask
{
// documentation inherited
@Override
protected void processService (File source, Class receiver)
{
System.out.println("Processing " + receiver.getName() + "...");
@@ -94,6 +94,7 @@ public class GenServiceTask extends InvocationTask
return getName().compareTo(other.getName());
}
@Override
public boolean equals (Object other)
{
return getClass().equals(other.getClass()) &&
@@ -134,6 +135,7 @@ public class GenServiceTask extends InvocationTask
}
// documentation inherited
@Override
protected void processService (File source, Class service)
{
System.out.println("Processing " + service.getName() + "...");
@@ -37,7 +37,6 @@ import org.apache.tools.ant.types.FileSet;
import com.threerings.io.SimpleStreamableObject;
import com.threerings.io.Streamable;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.DObject;
/**
@@ -55,9 +54,7 @@ public class GenStreamableTask extends Task
_filesets.add(set);
}
/**
* Performs the actual work of the task.
*/
@Override
public void execute () throws BuildException
{
for (FileSet fs : _filesets) {
@@ -27,8 +27,6 @@ import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.regex.Matcher;
@@ -91,9 +91,7 @@ public class ImportSet
_imports.add(name);
}
/**
* Makes a copy of this import set.
*/
@Override
public ImportSet clone ()
{
ImportSet newset = new ImportSet();
@@ -322,7 +320,7 @@ public class ImportSet
return list;
}
@Override // from Object
@Override
public String toString ()
{
return StringUtil.toString(_imports);
@@ -79,9 +79,7 @@ public class InstrumentStreamableTask extends Task
_outdir = outdir;
}
/**
* Performs the actual work of the task.
*/
@Override
public void execute () throws BuildException
{
// configure our ClassPool with our classpath
@@ -48,8 +48,6 @@ import com.samskivert.util.StringUtil;
import com.samskivert.velocity.VelocityUtil;
import com.threerings.presents.annotation.TransportHint;
import com.threerings.presents.net.Transport;
import com.threerings.presents.client.InvocationService.InvocationListener;
/**
@@ -331,7 +329,7 @@ public abstract class InvocationTask extends Task
((AntClassLoader)_cloader).setParent(getClass().getClassLoader());
}
/** Performs the actual work of the task. */
@Override
public void execute () throws BuildException
{
if (_cloader == null) {
@@ -213,9 +213,7 @@ public class SafeSubscriber<T extends DObject>
}
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
return "[oid=" + _oid +