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
@@ -49,7 +49,7 @@ public class AsStringFieldEditor extends FieldEditor
_value.addFocusListener(this); _value.addFocusListener(this);
} }
// documentation inherited @Override
protected Object getDisplayValue () protected Object getDisplayValue ()
throws Exception throws Exception
{ {
@@ -95,7 +95,7 @@ public class AsStringFieldEditor extends FieldEditor
} }
} }
// documentation inherited @Override
protected void displayValue (Object value) protected void displayValue (Object value)
{ {
_value.setText(StringUtil.toString(value, "", "")); _value.setText(StringUtil.toString(value, "", ""));
@@ -59,14 +59,14 @@ public class BooleanFieldEditor extends FieldEditor
_value.addFocusListener(this); _value.addFocusListener(this);
} }
// documentation inherited @Override
protected Object getDisplayValue () protected Object getDisplayValue ()
throws Exception throws Exception
{ {
return Boolean.valueOf(_value.isSelected()); return Boolean.valueOf(_value.isSelected());
} }
// documentation inherited @Override
protected void displayValue (Object value) protected void displayValue (Object value)
{ {
_value.setSelected(Boolean.TRUE.equals(value)); _value.setSelected(Boolean.TRUE.equals(value));
@@ -75,7 +75,7 @@ public class ConfigEditorPanel extends JPanel
service.getConfigInfo(_ctx.getClient(), this); service.getConfigInfo(_ctx.getClient(), this);
} }
// documentation inherited @Override
public void removeNotify () public void removeNotify ()
{ {
super.removeNotify(); super.removeNotify();
@@ -44,14 +44,17 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
_serverconfig = new HashMap<String, ConfigObject>(); _serverconfig = new HashMap<String, ConfigObject>();
_client = client; _client = client;
_client.addClientObserver(new ClientAdapter() { _client.addClientObserver(new ClientAdapter() {
@Override
public void clientWillLogon (Client client) { public void clientWillLogon (Client client) {
client.addServiceGroup(AdminCodes.ADMIN_GROUP); client.addServiceGroup(AdminCodes.ADMIN_GROUP);
} }
@Override
public void clientDidLogon (Client client) { public void clientDidLogon (Client client) {
_dobjmgr = _client.getDObjectManager(); _dobjmgr = _client.getDObjectManager();
_service = client.requireService(AdminService.class); _service = client.requireService(AdminService.class);
getConfigInfo(); getConfigInfo();
} }
@Override
public void clientDidLogoff (Client client) { public void clientDidLogoff (Client client) {
// Clean up our subscription to the server's configuration // Clean up our subscription to the server's configuration
for (int ii = 0; ii < _csubscribers.length; ii++) { for (int ii = 0; ii < _csubscribers.length; ii++) {
@@ -121,7 +121,7 @@ public class DSetEditor extends JPanel
return (DSet.Entry)_table.getSelectedObject(); return (DSet.Entry)_table.getSelectedObject();
} }
// documentation inherited @Override
public Dimension getPreferredSize () public Dimension getPreferredSize ()
{ {
Dimension d = super.getPreferredSize(); Dimension d = super.getPreferredSize();
@@ -129,7 +129,7 @@ public class DSetEditor extends JPanel
return d; return d;
} }
// documentation inherited @Override
public void addNotify () public void addNotify ()
{ {
super.addNotify(); super.addNotify();
@@ -140,7 +140,7 @@ public class DSetEditor extends JPanel
refreshData(); refreshData();
} }
// documentation inherited @Override
public void removeNotify () public void removeNotify ()
{ {
_setter.removeListener(this); _setter.removeListener(this);
@@ -65,7 +65,7 @@ public abstract class FieldEditor extends JPanel
updateBorder(false); updateBorder(false);
} }
// documentation inherited @Override
public void addNotify () public void addNotify ()
{ {
super.addNotify(); super.addNotify();
@@ -75,6 +75,7 @@ public abstract class FieldEditor extends JPanel
displayValue(getValue()); displayValue(getValue());
} }
@Override
public void removeNotify () public void removeNotify ()
{ {
super.removeNotify(); super.removeNotify();
@@ -72,7 +72,7 @@ public class ObjectEditorPanel extends ScrollablePanel
_safesub.subscribe(_ctx.getDObjectManager()); _safesub.subscribe(_ctx.getDObjectManager());
} }
// documentation inherited from interface @Override
public boolean getScrollableTracksViewportWidth () public boolean getScrollableTracksViewportWidth ()
{ {
return true; return true;
@@ -57,7 +57,7 @@ public class PulldownFieldEditor extends FieldEditor
value = val; value = val;
} }
// documentation inherited @Override
public String toString () public String toString ()
{ {
return _name; return _name;
@@ -95,21 +95,21 @@ public class PulldownFieldEditor extends FieldEditor
addChoice(new Choice(name, choice)); addChoice(new Choice(name, choice));
} }
// documentation inherited @Override
public void addNotify () public void addNotify ()
{ {
super.addNotify(); super.addNotify();
_value.addActionListener(this); _value.addActionListener(this);
} }
// documentation inherited @Override
public void removeNotify () public void removeNotify ()
{ {
_value.removeActionListener(this); _value.removeActionListener(this);
super.removeNotify(); super.removeNotify();
} }
// documentation inherited @Override
protected Object getDisplayValue () protected Object getDisplayValue ()
throws Exception throws Exception
{ {
@@ -120,7 +120,7 @@ public class PulldownFieldEditor extends FieldEditor
return ((Choice)obj).value; return ((Choice)obj).value;
} }
// documentation inherited @Override
protected void displayValue (Object value) protected void displayValue (Object value)
{ {
for (int ii = _value.getItemCount() - 1; ii >= 0; ii--) { for (int ii = _value.getItemCount() - 1; ii >= 0; ii--) {
@@ -140,6 +140,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
super.init(); super.init();
} }
@Override
protected boolean getValue (String field, boolean defval) { protected boolean getValue (String field, boolean defval) {
String value = _data.get(field); String value = _data.get(field);
if (value != null) { if (value != null) {
@@ -148,6 +149,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected short getValue (String field, short defval) { protected short getValue (String field, short defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -160,6 +162,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected int getValue (String field, int defval) { protected int getValue (String field, int defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -172,6 +175,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected long getValue (String field, long defval) { protected long getValue (String field, long defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -184,6 +188,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected float getValue (String field, float defval) { protected float getValue (String field, float defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -196,11 +201,13 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected String getValue (String field, String defval) { protected String getValue (String field, String defval) {
String value = _data.get(field); String value = _data.get(field);
return (value == null) ? defval : value; return (value == null) ? defval : value;
} }
@Override
protected int[] getValue (String field, int[] defval) { protected int[] getValue (String field, int[] defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -216,6 +223,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected float[] getValue (String field, float[] defval) { protected float[] getValue (String field, float[] defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -231,6 +239,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected long[] getValue (String field, long[] defval) { protected long[] getValue (String field, long[] defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -246,6 +255,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected String[] getValue (String field, String[] defval) { protected String[] getValue (String field, String[] defval) {
String value = _data.get(field); String value = _data.get(field);
try { try {
@@ -258,33 +268,43 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return defval; return defval;
} }
@Override
protected void setValue (String field, boolean value) { protected void setValue (String field, boolean value) {
setAndFlush(field, String.valueOf(value)); setAndFlush(field, String.valueOf(value));
} }
@Override
protected void setValue (String field, short value) { protected void setValue (String field, short value) {
setAndFlush(field, String.valueOf(value)); setAndFlush(field, String.valueOf(value));
} }
@Override
protected void setValue (String field, int value) { protected void setValue (String field, int value) {
setAndFlush(field, String.valueOf(value)); setAndFlush(field, String.valueOf(value));
} }
@Override
protected void setValue (String field, long value) { protected void setValue (String field, long value) {
setAndFlush(field, String.valueOf(value)); setAndFlush(field, String.valueOf(value));
} }
@Override
protected void setValue (String field, float value) { protected void setValue (String field, float value) {
setAndFlush(field, String.valueOf(value)); setAndFlush(field, String.valueOf(value));
} }
@Override
protected void setValue (String field, String value) { protected void setValue (String field, String value) {
setAndFlush(field, value); setAndFlush(field, value);
} }
@Override
protected void setValue (String field, int[] value) { protected void setValue (String field, int[] value) {
setAndFlush(field, StringUtil.toString(value, "", "")); setAndFlush(field, StringUtil.toString(value, "", ""));
} }
@Override
protected void setValue (String field, float[] value) { protected void setValue (String field, float[] value) {
setAndFlush(field, StringUtil.toString(value, "", "")); setAndFlush(field, StringUtil.toString(value, "", ""));
} }
@Override
protected void setValue (String field, long[] value) { protected void setValue (String field, long[] value) {
setAndFlush(field, StringUtil.toString(value, "", "")); setAndFlush(field, StringUtil.toString(value, "", ""));
} }
@Override
protected void setValue (String field, String[] value) { protected void setValue (String field, String[] value) {
setAndFlush(field, StringUtil.joinEscaped(value)); setAndFlush(field, StringUtil.joinEscaped(value));
} }
@@ -293,6 +313,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
_data.put(field, value); _data.put(field, value);
String iname = "updateConfig(" + _path + ", " + field + ", value=" + value + ")"; String iname = "updateConfig(" + _path + ", " + field + ", value=" + value + ")";
_invoker.postUnit(new WriteOnlyUnit(iname) { _invoker.postUnit(new WriteOnlyUnit(iname) {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
_repo.updateConfig(_node, _path, field, value); _repo.updateConfig(_node, _path, field, value);
} }
@@ -51,64 +51,84 @@ public class PrefsConfigRegistry extends ConfigRegistry
this.config = new PrefsConfig(path); this.config = new PrefsConfig(path);
} }
@Override
protected boolean getValue (String field, boolean defval) { protected boolean getValue (String field, boolean defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected short getValue (String field, short defval) { protected short getValue (String field, short defval) {
return (short)config.getValue(field, defval); return (short)config.getValue(field, defval);
} }
@Override
protected int getValue (String field, int defval) { protected int getValue (String field, int defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected long getValue (String field, long defval) { protected long getValue (String field, long defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected float getValue (String field, float defval) { protected float getValue (String field, float defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected String getValue (String field, String defval) { protected String getValue (String field, String defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected int[] getValue (String field, int[] defval) { protected int[] getValue (String field, int[] defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected float[] getValue (String field, float[] defval) { protected float[] getValue (String field, float[] defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected long[] getValue (String field, long[] defval) { protected long[] getValue (String field, long[] defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected String[] getValue (String field, String[] defval) { protected String[] getValue (String field, String[] defval) {
return config.getValue(field, defval); return config.getValue(field, defval);
} }
@Override
protected void setValue (String field, boolean value) { protected void setValue (String field, boolean value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, short value) { protected void setValue (String field, short value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, int value) { protected void setValue (String field, int value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, long value) { protected void setValue (String field, long value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, float value) { protected void setValue (String field, float value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, String value) { protected void setValue (String field, String value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, int[] value) { protected void setValue (String field, int[] value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, float[] value) { protected void setValue (String field, float[] value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, long[] value) { protected void setValue (String field, long[] value) {
config.setValue(field, value); config.setValue(field, value);
} }
@Override
protected void setValue (String field, String[] value) { protected void setValue (String field, String[] value) {
config.setValue(field, value); config.setValue(field, value);
} }
@@ -31,6 +31,7 @@ public class ConfigDatum
public String field; public String field;
public String value; public String value;
@Override
public String toString () { public String toString () {
return node + "." + object + "." + field + "=" + value + "]"; return node + "." + object + "." + field + "=" + value + "]";
} }
@@ -197,6 +197,7 @@ public class BureauRegistry
ProcessLogger.copyMergedOutput(log, bureauId, process); ProcessLogger.copyMergedOutput(log, bureauId, process);
} }
@Override
public String toString () { public String toString () {
return "DefaultLauncher for " + cmdGenerator; return "DefaultLauncher for " + cmdGenerator;
} }
@@ -586,6 +587,7 @@ public class BureauRegistry
_bureau = bureau; _bureau = bureau;
} }
@Override
public boolean invoke () public boolean invoke ()
{ {
try { try {
@@ -597,6 +599,7 @@ public class BureauRegistry
return true; return true;
} }
@Override
public void handleResult () public void handleResult ()
{ {
_bureau.launched = true; _bureau.launched = true;
@@ -677,6 +680,7 @@ public class BureauRegistry
// The states of the various agents allocated to this bureau // The states of the various agents allocated to this bureau
Map<AgentObject, Integer> agentStates = Maps.newHashMap(); Map<AgentObject, Integer> agentStates = Maps.newHashMap();
@Override
public String toString () public String toString ()
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@@ -653,7 +653,7 @@ public class ChatDirector extends BasicDirector
} }
} }
// documentation inherited @Override
public void clientDidLogon (Client client) public void clientDidLogon (Client client)
{ {
super.clientDidLogon(client); super.clientDidLogon(client);
@@ -662,7 +662,7 @@ public class ChatDirector extends BasicDirector
addAuxiliarySource(_clobj = client.getClientObject(), USER_CHAT_TYPE); addAuxiliarySource(_clobj = client.getClientObject(), USER_CHAT_TYPE);
} }
// documentation inherited @Override
public void clientObjectDidChange (Client client) public void clientObjectDidChange (Client client)
{ {
super.clientObjectDidChange(client); super.clientObjectDidChange(client);
@@ -674,7 +674,7 @@ public class ChatDirector extends BasicDirector
clearDisplays(); clearDisplays();
} }
// documentation inherited @Override
public void clientDidLogoff (Client client) public void clientDidLogoff (Client client)
{ {
super.clientDidLogoff(client); super.clientDidLogoff(client);
@@ -1038,13 +1038,13 @@ public class ChatDirector extends BasicDirector
return (type == null) ? PLACE_CHAT_TYPE : type; return (type == null) ? PLACE_CHAT_TYPE : type;
} }
@Override // from BasicDirector @Override
protected void registerServices (Client client) protected void registerServices (Client client)
{ {
client.addServiceGroup(CrowdCodes.CROWD_GROUP); client.addServiceGroup(CrowdCodes.CROWD_GROUP);
} }
@Override // from BasicDirector @Override
protected void fetchServices (Client client) protected void fetchServices (Client client)
{ {
// get a handle on our chat service // get a handle on our chat service
@@ -1110,6 +1110,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/help</code>. */ /** Implements <code>/help</code>. */
protected class HelpHandler extends CommandHandler protected class HelpHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1161,6 +1162,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/clear</code>. */ /** Implements <code>/clear</code>. */
protected class ClearHandler extends CommandHandler protected class ClearHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1172,6 +1174,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/speak</code>. */ /** Implements <code>/speak</code>. */
protected class SpeakHandler extends CommandHandler protected class SpeakHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1189,6 +1192,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/emote</code>. */ /** Implements <code>/emote</code>. */
protected class EmoteHandler extends CommandHandler protected class EmoteHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1204,6 +1208,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/think</code>. */ /** Implements <code>/think</code>. */
protected class ThinkHandler extends CommandHandler protected class ThinkHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1219,6 +1224,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/tell</code>. */ /** Implements <code>/tell</code>. */
protected class TellHandler extends CommandHandler protected class TellHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, final String command, public String handleCommand (SpeakService speakSvc, final String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1339,6 +1345,7 @@ public class ChatDirector extends BasicDirector
/** Implements <code>/broadcast</code>. */ /** Implements <code>/broadcast</code>. */
protected class BroadcastHandler extends CommandHandler protected class BroadcastHandler extends CommandHandler
{ {
@Override
public String handleCommand (SpeakService speakSvc, String command, public String handleCommand (SpeakService speakSvc, String command,
String args, String[] history) String args, String[] history)
{ {
@@ -1362,6 +1369,7 @@ public class ChatDirector extends BasicDirector
return ChatCodes.SUCCESS; return ChatCodes.SUCCESS;
} }
@Override
public boolean checkAccess (BodyObject user) public boolean checkAccess (BodyObject user)
{ {
return user.checkAccess(ChatCodes.BROADCAST_ACCESS) == null; return user.checkAccess(ChatCodes.BROADCAST_ACCESS) == null;
@@ -82,9 +82,7 @@ public abstract class ChatMessage
return null; return null;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return StringUtil.shortClassName(this) + StringUtil.fieldsToString(this); return StringUtil.shortClassName(this) + StringUtil.fieldsToString(this);
@@ -393,7 +393,7 @@ public class LocationDirector extends BasicDirector
} }
} }
// documentation inherited from interface @Override
public void clientDidLogon (Client client) public void clientDidLogon (Client client)
{ {
super.clientDidLogon(client); super.clientDidLogon(client);
@@ -412,7 +412,7 @@ public class LocationDirector extends BasicDirector
client.getDObjectManager().subscribeToObject(cloid, sub); client.getDObjectManager().subscribeToObject(cloid, sub);
} }
// documentation inherited from interface @Override
public void clientDidLogoff (Client client) public void clientDidLogoff (Client client)
{ {
super.clientDidLogoff(client); super.clientDidLogoff(client);
@@ -432,13 +432,13 @@ public class LocationDirector extends BasicDirector
_lservice = null; _lservice = null;
} }
@Override // from BasicDirector @Override
protected void registerServices (Client client) protected void registerServices (Client client)
{ {
client.addServiceGroup(CrowdCodes.CROWD_GROUP); client.addServiceGroup(CrowdCodes.CROWD_GROUP);
} }
// documentation inherited @Override
protected void fetchServices (Client client) protected void fetchServices (Client client)
{ {
// obtain our service handle // obtain our service handle
@@ -107,7 +107,7 @@ public class OccupantDirector extends BasicDirector
return (_place == null) ? null : _place.getOccupantInfo(username); return (_place == null) ? null : _place.getOccupantInfo(username);
} }
// documentation inherited from interface @Override
public void clientDidLogoff (Client client) public void clientDidLogoff (Client client)
{ {
// clear things out // clear things out
@@ -80,6 +80,7 @@ public abstract class PlaceController extends Controller
// initialize our delegates // initialize our delegates
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) { applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
delegate.init(_ctx, _config); delegate.init(_ctx, _config);
} }
@@ -162,6 +163,7 @@ public abstract class PlaceController extends Controller
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) { applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
delegate.willEnterPlace(plobj); delegate.willEnterPlace(plobj);
} }
@@ -183,6 +185,7 @@ public abstract class PlaceController extends Controller
{ {
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) { applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
delegate.mayLeavePlace(plobj); delegate.mayLeavePlace(plobj);
} }
@@ -200,6 +203,7 @@ public abstract class PlaceController extends Controller
{ {
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) { applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
delegate.didLeavePlace(plobj); delegate.didLeavePlace(plobj);
} }
@@ -220,12 +224,14 @@ public abstract class PlaceController extends Controller
* should be sure to call <code>super.handleAction</code> for events * should be sure to call <code>super.handleAction</code> for events
* they don't specifically handle. * they don't specifically handle.
*/ */
@Override
public boolean handleAction (final ActionEvent action) public boolean handleAction (final ActionEvent action)
{ {
final boolean[] handled = new boolean[1]; final boolean[] handled = new boolean[1];
// let our delegates have a crack at the action // let our delegates have a crack at the action
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) { applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
// we take advantage of short-circuiting here // we take advantage of short-circuiting here
handled[0] = handled[0] || delegate.handleAction(action); handled[0] = handled[0] || delegate.handleAction(action);
@@ -140,7 +140,7 @@ public class BodyObject extends ClientObject
op.apply(getOid()); op.apply(getOid());
} }
// documentation inherited @Override
public String who () public String who ()
{ {
StringBuilder buf = new StringBuilder(username.toString()); StringBuilder buf = new StringBuilder(username.toString());
@@ -92,9 +92,7 @@ public class OccupantInfo extends SimpleStreamableObject
return bodyOid; return bodyOid;
} }
/** @Override
* Generates a cloned copy of this instance.
*/
public Object clone () public Object clone ()
{ {
try { try {
@@ -89,7 +89,7 @@ public abstract class PlaceConfig extends SimpleStreamableObject
*/ */
public abstract String getManagerClassName (); public abstract String getManagerClassName ();
// documentation inherited @Override
@ActionScript(name="toStringBuilder") @ActionScript(name="toStringBuilder")
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
@@ -34,7 +34,7 @@ import com.threerings.crowd.data.OccupantInfo;
*/ */
public class CrowdClient extends PresentsClient public class CrowdClient extends PresentsClient
{ {
// documentation inherited @Override
protected void sessionConnectionClosed () protected void sessionConnectionClosed ()
{ {
super.sessionConnectionClosed(); super.sessionConnectionClosed();
@@ -46,7 +46,7 @@ public class CrowdClient extends PresentsClient
} }
} }
// documentation inherited @Override
protected void sessionWillResume () protected void sessionWillResume ()
{ {
super.sessionWillResume(); super.sessionWillResume();
@@ -56,7 +56,7 @@ public class CrowdClient extends PresentsClient
_bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.ACTIVE); _bodyman.updateOccupantStatus(bobj, bobj.location, OccupantInfo.ACTIVE);
} }
// documentation inherited @Override
protected void sessionDidEnd () protected void sessionDidEnd ()
{ {
super.sessionDidEnd(); super.sessionDidEnd();
@@ -25,7 +25,6 @@ import com.google.inject.Guice;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Injector; import com.google.inject.Injector;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.threerings.util.Name; import com.threerings.util.Name;
import com.threerings.presents.net.AuthRequest; import com.threerings.presents.net.AuthRequest;
@@ -33,7 +32,6 @@ import com.threerings.presents.server.ClientFactory;
import com.threerings.presents.server.ClientResolver; import com.threerings.presents.server.ClientResolver;
import com.threerings.presents.server.PresentsClient; import com.threerings.presents.server.PresentsClient;
import com.threerings.presents.server.PresentsServer; import com.threerings.presents.server.PresentsServer;
import com.threerings.crowd.chat.server.ChatProvider; import com.threerings.crowd.chat.server.ChatProvider;
import static com.threerings.crowd.Log.log; import static com.threerings.crowd.Log.log;
@@ -56,6 +54,7 @@ public class CrowdServer extends PresentsServer
/** /**
* Initializes all of the server services and prepares for operation. * Initializes all of the server services and prepares for operation.
*/ */
@Override
public void init (Injector injector) public void init (Injector injector)
throws Exception throws Exception
{ {
@@ -193,6 +193,7 @@ public class PlaceManager
// initialize our delegates // initialize our delegates
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.init(PlaceManager.this, _omgr, _invmgr); delegate.init(PlaceManager.this, _omgr, _invmgr);
} }
@@ -442,6 +443,7 @@ public class PlaceManager
* *
* @see #toString(StringBuilder) * @see #toString(StringBuilder)
*/ */
@Override
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -483,6 +485,7 @@ public class PlaceManager
{ {
// initialize our delegates // initialize our delegates
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.didInit(_config); delegate.didInit(_config);
} }
@@ -524,6 +527,7 @@ public class PlaceManager
{ {
// let our delegates know that we've started up // let our delegates know that we've started up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.didStartup(_plobj); delegate.didStartup(_plobj);
} }
@@ -543,6 +547,7 @@ public class PlaceManager
// let our delegates know that we've shut down // let our delegates know that we've shut down
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.didShutdown(); delegate.didShutdown();
} }
@@ -568,6 +573,7 @@ public class PlaceManager
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.bodyEntered(bodyOid); delegate.bodyEntered(bodyOid);
} }
@@ -596,6 +602,7 @@ public class PlaceManager
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.bodyLeft(bodyOid); delegate.bodyLeft(bodyOid);
} }
@@ -622,6 +629,7 @@ public class PlaceManager
{ {
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.bodyUpdated(info); delegate.bodyUpdated(info);
} }
@@ -637,6 +645,7 @@ public class PlaceManager
{ {
// let our delegates know what's up // let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
@Override
public void apply (PlaceManagerDelegate delegate) { public void apply (PlaceManagerDelegate delegate) {
delegate.placeBecameEmpty(); delegate.placeBecameEmpty();
} }
@@ -656,6 +665,7 @@ public class PlaceManager
long idlePeriod = idleUnloadPeriod(); long idlePeriod = idleUnloadPeriod();
if (idlePeriod > 0L && _shutdownInterval == null) { if (idlePeriod > 0L && _shutdownInterval == null) {
_shutdownInterval = new Interval(_omgr) { _shutdownInterval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
log.debug("Unloading idle place '" + where () + "'."); log.debug("Unloading idle place '" + where () + "'.");
shutdown(); shutdown();
@@ -698,6 +708,7 @@ public class PlaceManager
/** Listens for occupant updates. */ /** Listens for occupant updates. */
protected SetAdapter _bodyUpdater = new SetAdapter() { protected SetAdapter _bodyUpdater = new SetAdapter() {
@Override
public void entryUpdated (EntryUpdatedEvent event) { public void entryUpdated (EntryUpdatedEvent event) {
if (event.getName().equals(PlaceObject.OCCUPANT_INFO)) { if (event.getName().equals(PlaceObject.OCCUPANT_INFO)) {
bodyUpdated((OccupantInfo)event.getEntry()); bodyUpdated((OccupantInfo)event.getEntry());
@@ -36,7 +36,6 @@ import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.InvocationManager; import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.ShutdownManager; import com.threerings.presents.server.ShutdownManager;
import com.threerings.crowd.data.Place;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.data.PlaceObject;
+39 -38
View File
@@ -85,14 +85,14 @@ public class BasicStreamers
/** Streams {@link Boolean} instances. */ /** Streams {@link Boolean} instances. */
public static class BooleanStreamer extends BasicStreamer public static class BooleanStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Boolean.valueOf(in.readBoolean()); return Boolean.valueOf(in.readBoolean());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -103,14 +103,14 @@ public class BasicStreamers
/** Streams {@link Byte} instances. */ /** Streams {@link Byte} instances. */
public static class ByteStreamer extends BasicStreamer public static class ByteStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Byte.valueOf(in.readByte()); return Byte.valueOf(in.readByte());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -121,14 +121,14 @@ public class BasicStreamers
/** Streams {@link Short} instances. */ /** Streams {@link Short} instances. */
public static class ShortStreamer extends BasicStreamer public static class ShortStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Short.valueOf(in.readShort()); return Short.valueOf(in.readShort());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -139,13 +139,13 @@ public class BasicStreamers
/** Streams {@link Character} instances. */ /** Streams {@link Character} instances. */
public static class CharacterStreamer extends BasicStreamer public static class CharacterStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in)throws IOException public Object createObject (ObjectInputStream in)throws IOException
{ {
return Character.valueOf(in.readChar()); return Character.valueOf(in.readChar());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -156,14 +156,14 @@ public class BasicStreamers
/** Streams {@link Integer} instances. */ /** Streams {@link Integer} instances. */
public static class IntegerStreamer extends BasicStreamer public static class IntegerStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Integer.valueOf(in.readInt()); return Integer.valueOf(in.readInt());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -174,14 +174,14 @@ public class BasicStreamers
/** Streams {@link Long} instances. */ /** Streams {@link Long} instances. */
public static class LongStreamer extends BasicStreamer public static class LongStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Long.valueOf(in.readLong()); return Long.valueOf(in.readLong());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -192,14 +192,14 @@ public class BasicStreamers
/** Streams {@link Float} instances. */ /** Streams {@link Float} instances. */
public static class FloatStreamer extends BasicStreamer public static class FloatStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Float.valueOf(in.readFloat()); return Float.valueOf(in.readFloat());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -210,14 +210,14 @@ public class BasicStreamers
/** Streams {@link Double} instances. */ /** Streams {@link Double} instances. */
public static class DoubleStreamer extends BasicStreamer public static class DoubleStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return Double.valueOf(in.readDouble()); return Double.valueOf(in.readDouble());
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -228,14 +228,14 @@ public class BasicStreamers
/** Streams {@link String} instances. */ /** Streams {@link String} instances. */
public static class StringStreamer extends BasicStreamer public static class StringStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return in.readUTF(); return in.readUTF();
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -246,14 +246,14 @@ public class BasicStreamers
/** Streams arrays of booleans. */ /** Streams arrays of booleans. */
public static class BooleanArrayStreamer extends BasicStreamer public static class BooleanArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readBooleanArray(in); return readBooleanArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -264,14 +264,14 @@ public class BasicStreamers
/** Streams arrays of bytes. */ /** Streams arrays of bytes. */
public static class ByteArrayStreamer extends BasicStreamer public static class ByteArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readByteArray(in); return readByteArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -282,14 +282,14 @@ public class BasicStreamers
/** Streams arrays of shorts. */ /** Streams arrays of shorts. */
public static class ShortArrayStreamer extends BasicStreamer public static class ShortArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readShortArray(in); return readShortArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -300,14 +300,14 @@ public class BasicStreamers
/** Streams arrays of chars. */ /** Streams arrays of chars. */
public static class CharArrayStreamer extends BasicStreamer public static class CharArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readCharArray(in); return readCharArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -318,14 +318,14 @@ public class BasicStreamers
/** Streams arrays of ints. */ /** Streams arrays of ints. */
public static class IntArrayStreamer extends BasicStreamer public static class IntArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readIntArray(in); return readIntArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -336,14 +336,14 @@ public class BasicStreamers
/** Streams arrays of longs. */ /** Streams arrays of longs. */
public static class LongArrayStreamer extends BasicStreamer public static class LongArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readLongArray(in); return readLongArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -354,14 +354,14 @@ public class BasicStreamers
/** Streams arrays of floats. */ /** Streams arrays of floats. */
public static class FloatArrayStreamer extends BasicStreamer public static class FloatArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readFloatArray(in); return readFloatArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -372,14 +372,14 @@ public class BasicStreamers
/** Streams arrays of doubles. */ /** Streams arrays of doubles. */
public static class DoubleArrayStreamer extends BasicStreamer public static class DoubleArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException throws IOException
{ {
return readDoubleArray(in); return readDoubleArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -390,14 +390,14 @@ public class BasicStreamers
/** Streams arrays of Object instances. */ /** Streams arrays of Object instances. */
public static class ObjectArrayStreamer extends BasicStreamer public static class ObjectArrayStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException, ClassNotFoundException throws IOException, ClassNotFoundException
{ {
return readObjectArray(in); return readObjectArray(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -408,14 +408,14 @@ public class BasicStreamers
/** Streams {@link List} instances. */ /** Streams {@link List} instances. */
public static class ListStreamer extends BasicStreamer public static class ListStreamer extends BasicStreamer
{ {
// documentation inherited @Override
public Object createObject (ObjectInputStream in) public Object createObject (ObjectInputStream in)
throws IOException, ClassNotFoundException throws IOException, ClassNotFoundException
{ {
return readList(in); return readList(in);
} }
// documentation inherited @Override
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter) public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
throws IOException throws IOException
{ {
@@ -426,6 +426,7 @@ public class BasicStreamers
/** Streams {@link String} instances. */ /** Streams {@link String} instances. */
public static class BasicStreamer extends Streamer public static class BasicStreamer extends Streamer
{ {
@Override
public void readObject (Object object, ObjectInputStream in, boolean useReader) public void readObject (Object object, ObjectInputStream in, boolean useReader)
throws IOException, ClassNotFoundException throws IOException, ClassNotFoundException
{ {
@@ -38,6 +38,7 @@ class ClassMapping
this.streamer = streamer; this.streamer = streamer;
} }
@Override
public String toString () public String toString ()
{ {
return "[code=" + code + ", class=" + sclass.getName() + "]"; return "[code=" + code + ", class=" + sclass.getName() + "]";
@@ -141,7 +141,7 @@ public abstract class FieldMarshaller
_streamer = streamer; _streamer = streamer;
} }
// documentation inherited @Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception throws Exception
{ {
@@ -154,7 +154,7 @@ public abstract class FieldMarshaller
} }
} }
// documentation inherited @Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception throws Exception
{ {
@@ -167,6 +167,7 @@ public abstract class FieldMarshaller
} }
} }
@Override
public String toString () public String toString ()
{ {
return "StreamerMarshaller:" + _streamer.toString(); return "StreamerMarshaller:" + _streamer.toString();
@@ -187,14 +188,14 @@ public abstract class FieldMarshaller
_writer = writer; _writer = writer;
} }
// documentation inherited @Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception throws Exception
{ {
_reader.invoke(target, in); _reader.invoke(target, in);
} }
// documentation inherited @Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception throws Exception
{ {
@@ -215,10 +216,12 @@ public abstract class FieldMarshaller
// create a generic marshaller for streamable instances // create a generic marshaller for streamable instances
FieldMarshaller gmarsh = new FieldMarshaller() { FieldMarshaller gmarsh = new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.set(target, in.readObject()); field.set(target, in.readObject());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeObject(field.get(source)); out.writeObject(field.get(source));
@@ -234,90 +237,108 @@ public abstract class FieldMarshaller
// create marshallers for the primitive types // create marshallers for the primitive types
_marshallers.put(Boolean.TYPE, new FieldMarshaller() { _marshallers.put(Boolean.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setBoolean(target, in.readBoolean()); field.setBoolean(target, in.readBoolean());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeBoolean(field.getBoolean(source)); out.writeBoolean(field.getBoolean(source));
} }
}); });
_marshallers.put(Byte.TYPE, new FieldMarshaller() { _marshallers.put(Byte.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setByte(target, in.readByte()); field.setByte(target, in.readByte());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeByte(field.getByte(source)); out.writeByte(field.getByte(source));
} }
}); });
_marshallers.put(Character.TYPE, new FieldMarshaller() { _marshallers.put(Character.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setChar(target, in.readChar()); field.setChar(target, in.readChar());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeChar(field.getChar(source)); out.writeChar(field.getChar(source));
} }
}); });
_marshallers.put(Short.TYPE, new FieldMarshaller() { _marshallers.put(Short.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setShort(target, in.readShort()); field.setShort(target, in.readShort());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeShort(field.getShort(source)); out.writeShort(field.getShort(source));
} }
}); });
_marshallers.put(Integer.TYPE, new FieldMarshaller() { _marshallers.put(Integer.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setInt(target, in.readInt()); field.setInt(target, in.readInt());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeInt(field.getInt(source)); out.writeInt(field.getInt(source));
} }
}); });
_marshallers.put(Long.TYPE, new FieldMarshaller() { _marshallers.put(Long.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setLong(target, in.readLong()); field.setLong(target, in.readLong());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeLong(field.getLong(source)); out.writeLong(field.getLong(source));
} }
}); });
_marshallers.put(Float.TYPE, new FieldMarshaller() { _marshallers.put(Float.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setFloat(target, in.readFloat()); field.setFloat(target, in.readFloat());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeFloat(field.getFloat(source)); out.writeFloat(field.getFloat(source));
} }
}); });
_marshallers.put(Double.TYPE, new FieldMarshaller() { _marshallers.put(Double.TYPE, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.setDouble(target, in.readDouble()); field.setDouble(target, in.readDouble());
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeDouble(field.getDouble(source)); out.writeDouble(field.getDouble(source));
} }
}); });
_marshallers.put(Date.class, new FieldMarshaller() { _marshallers.put(Date.class, new FieldMarshaller() {
@Override
public void readField (Field field, Object target, ObjectInputStream in) public void readField (Field field, Object target, ObjectInputStream in)
throws Exception { throws Exception {
field.set(target, new Date(in.readLong())); field.set(target, new Date(in.readLong()));
} }
@Override
public void writeField (Field field, Object source, ObjectOutputStream out) public void writeField (Field field, Object source, ObjectOutputStream out)
throws Exception { throws Exception {
out.writeLong(((Date)field.get(source)).getTime()); out.writeLong(((Date)field.get(source)).getTime());
@@ -193,6 +193,7 @@ public class FramedInputStream extends InputStream
* @return the next byte of data, or <code>-1</code> if the end of the * @return the next byte of data, or <code>-1</code> if the end of the
* stream has been reached. * stream has been reached.
*/ */
@Override
public int read () public int read ()
{ {
return (_buffer.remaining() > 0) ? (_buffer.get() & 0xFF) : -1; return (_buffer.remaining() > 0) ? (_buffer.get() & 0xFF) : -1;
@@ -221,6 +222,7 @@ public class FramedInputStream extends InputStream
* <code>-1</code> if there is no more data because the end of the * <code>-1</code> if there is no more data because the end of the
* stream has been reached. * stream has been reached.
*/ */
@Override
public int read (byte[] b, int off, int len) public int read (byte[] b, int off, int len)
{ {
// if they want no bytes, we give them no bytes; this is // if they want no bytes, we give them no bytes; this is
@@ -252,6 +254,7 @@ public class FramedInputStream extends InputStream
* *
* @return the actual number of bytes skipped. * @return the actual number of bytes skipped.
*/ */
@Override
public long skip (long n) public long skip (long n)
{ {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
@@ -264,6 +267,7 @@ public class FramedInputStream extends InputStream
* @return the number of bytes remaining to be read from the buffered * @return the number of bytes remaining to be read from the buffered
* frame. * frame.
*/ */
@Override
public int available () public int available ()
{ {
return _buffer.remaining(); return _buffer.remaining();
@@ -273,6 +277,7 @@ public class FramedInputStream extends InputStream
* Always returns false as framed input streams do not support * Always returns false as framed input streams do not support
* marking. * marking.
*/ */
@Override
public boolean markSupported () public boolean markSupported ()
{ {
return false; return false;
@@ -281,6 +286,7 @@ public class FramedInputStream extends InputStream
/** /**
* Does nothing, as marking is not supported. * Does nothing, as marking is not supported.
*/ */
@Override
public void mark (int readAheadLimit) public void mark (int readAheadLimit)
{ {
// not supported; do nothing // not supported; do nothing
@@ -289,6 +295,7 @@ public class FramedInputStream extends InputStream
/** /**
* Resets the buffer to the beginning of the buffered frames. * Resets the buffer to the beginning of the buffered frames.
*/ */
@Override
public void reset () public void reset ()
{ {
// position our buffer at the beginning of the frame data // position our buffer at the beginning of the frame data
@@ -230,9 +230,7 @@ public class ObjectInputStream extends DataInputStream
_streamer.readObject(_current, this, false); _streamer.readObject(_current, this, false);
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[hash=" + hashCode() + ", mappings=" + _classmap.size() + return "[hash=" + hashCode() + ", mappings=" + _classmap.size() +
@@ -31,9 +31,7 @@ import com.threerings.util.ActionScript;
*/ */
public class SimpleStreamableObject implements Streamable public class SimpleStreamableObject implements Streamable
{ {
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder("["); StringBuilder buf = new StringBuilder("[");
+1 -3
View File
@@ -391,9 +391,7 @@ public class Streamer
} }
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return (_target == null) ? getClass().getName() : return (_target == null) ? getClass().getName() :
@@ -33,9 +33,7 @@ import com.threerings.util.TrackedObject;
public class TrackedStreamableObject extends TrackedObject public class TrackedStreamableObject extends TrackedObject
implements Streamable implements Streamable
{ {
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder("["); StringBuilder buf = new StringBuilder("[");
@@ -540,6 +540,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_Reader"); super("BlockingCommunicator_Reader");
} }
@Override
protected void willStart () protected void willStart ()
{ {
// first we connect and authenticate with the server // 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 // now that we're authenticated, we manage the reading half of things by continuously
// reading messages from the socket and processing them // reading messages from the socket and processing them
@Override
protected void iterate () protected void iterate ()
{ {
DownstreamMessage msg = null; DownstreamMessage msg = null;
@@ -642,17 +644,20 @@ public class BlockingCommunicator extends Communicator
} }
} }
@Override
protected void handleIterateFailure (Exception e) protected void handleIterateFailure (Exception e)
{ {
log.warning("Uncaught exception it reader thread.", e); log.warning("Uncaught exception it reader thread.", e);
} }
@Override
protected void didShutdown () protected void didShutdown ()
{ {
// let the communicator know when we finally go away // let the communicator know when we finally go away
readerDidExit(); readerDidExit();
} }
@Override
protected void kick () protected void kick ()
{ {
// we want to interrupt the reader thread as it may be blocked listening to the socket; // 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"); super("BlockingCommunicator_Writer");
} }
@Override
protected void iterate () protected void iterate ()
{ {
// fetch the next message from the queue // fetch the next message from the queue
@@ -700,16 +706,19 @@ public class BlockingCommunicator extends Communicator
} }
} }
@Override
protected void handleIterateFailure (Exception e) protected void handleIterateFailure (Exception e)
{ {
log.warning("Uncaught exception it writer thread.", e); log.warning("Uncaught exception it writer thread.", e);
} }
@Override
protected void didShutdown () protected void didShutdown ()
{ {
writerDidExit(); writerDidExit();
} }
@Override
protected void kick () protected void kick ()
{ {
// post a bogus message to the outgoing queue to ensure that the writer thread notices // 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"); super("BlockingCommunicator_DatagramReader");
} }
@Override
protected void willStart () protected void willStart ()
{ {
try { try {
@@ -823,6 +833,7 @@ public class BlockingCommunicator extends Communicator
return false; return false;
} }
@Override
protected void iterate () protected void iterate ()
{ {
DownstreamMessage msg = null; DownstreamMessage msg = null;
@@ -849,16 +860,19 @@ public class BlockingCommunicator extends Communicator
} }
} }
@Override
protected void handleIterateFailure (Exception e) protected void handleIterateFailure (Exception e)
{ {
log.warning("Uncaught exception in datagram reader thread.", e); log.warning("Uncaught exception in datagram reader thread.", e);
} }
@Override
protected void didShutdown () protected void didShutdown ()
{ {
datagramReaderDidExit(); datagramReaderDidExit();
} }
@Override
protected void kick () protected void kick ()
{ {
// if we have a selector, wake it up // if we have a selector, wake it up
@@ -878,6 +892,7 @@ public class BlockingCommunicator extends Communicator
super("BlockingCommunicator_DatagramWriter"); super("BlockingCommunicator_DatagramWriter");
} }
@Override
protected void iterate () protected void iterate ()
{ {
// fetch the next message from the queue // fetch the next message from the queue
@@ -898,16 +913,19 @@ public class BlockingCommunicator extends Communicator
} }
} }
@Override
protected void handleIterateFailure (Exception e) protected void handleIterateFailure (Exception e)
{ {
log.warning("Uncaught exception in datagram writer thread.", e); log.warning("Uncaught exception in datagram writer thread.", e);
} }
@Override
protected void didShutdown () protected void didShutdown ()
{ {
datagramWriterDidExit(); datagramWriterDidExit();
} }
@Override
protected void kick () protected void kick ()
{ {
// post a bogus message to the outgoing queue to ensure that the writer thread notices // post a bogus message to the outgoing queue to ensure that the writer thread notices
@@ -425,9 +425,11 @@ public class Client
// appropriate // appropriate
if (_tickInterval == null) { if (_tickInterval == null) {
_tickInterval = new Interval(_runQueue) { _tickInterval = new Interval(_runQueue) {
@Override
public void expired () { public void expired () {
tick(); tick();
} }
@Override
public String toString () { public String toString () {
return "Client.tickInterval"; return "Client.tickInterval";
} }
@@ -897,6 +899,7 @@ public class Client
} }
} }
@Override
public void clientDidClear (Client client) public void clientDidClear (Client client)
{ {
// configure the client to point to the new server and logon // configure the client to point to the new server and logon
@@ -910,6 +913,7 @@ public class Client
} }
} }
@Override
public void clientDidLogon (Client client) public void clientDidLogon (Client client)
{ {
removeClientObserver(this); removeClientObserver(this);
@@ -918,6 +922,7 @@ public class Client
} }
} }
@Override
public void clientFailedToLogon (Client client, Exception cause) public void clientFailedToLogon (Client client, Exception cause)
{ {
removeClientObserver(this); removeClientObserver(this);
@@ -144,6 +144,7 @@ public class ClientCommunicator extends BlockingCommunicator
_nextPort = nextPort; _nextPort = nextPort;
} }
@Override
public void expired () { public void expired () {
if (clearPPI(false)) { if (clearPPI(false)) {
setPrefPort(_key, _thisPort); setPrefPort(_key, _thisPort);
@@ -66,6 +66,7 @@ public class ClientDObjectMgr
// register a flush interval // register a flush interval
new Interval(client.getRunQueue()) { new Interval(client.getRunQueue()) {
@Override
public void expired () { public void expired () {
flushObjects(); flushObjects();
} }
@@ -440,6 +441,7 @@ public class ClientDObjectMgr
this.subscribe = subscribe; this.subscribe = subscribe;
} }
@Override
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -79,7 +79,7 @@ public interface InvocationReceiver
return receiverCode; return receiverCode;
} }
/** Generates a string representation of this instance. */ @Override
public String toString () public String toString ()
{ {
return "[" + receiverCode + " => " + receiverId + "]"; return "[" + receiverCode + " => " + receiverId + "]";
@@ -26,8 +26,6 @@ import com.samskivert.util.StringUtil;
import com.threerings.io.Streamable; import com.threerings.io.Streamable;
import com.threerings.presents.client.Client; 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.client.InvocationService;
import com.threerings.presents.dobj.DObjectManager; import com.threerings.presents.dobj.DObjectManager;
@@ -116,16 +114,14 @@ public class InvocationMarshaller
} }
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[callerOid=" + callerOid + ", reqId=" + requestId + return "[callerOid=" + callerOid + ", reqId=" + requestId +
", type=" + getClass().getName() + "]"; ", type=" + getClass().getName() + "]";
} }
// documentation inherited @Override
protected void finalize () protected void finalize ()
throws Throwable throws Throwable
{ {
@@ -156,7 +152,7 @@ public class InvocationMarshaller
callerOid, requestId, REQUEST_PROCESSED, null, transport)); callerOid, requestId, REQUEST_PROCESSED, null, transport));
} }
// documentation inherited @Override
public void dispatchResponse (int methodId, Object[] args) public void dispatchResponse (int methodId, Object[] args)
{ {
switch (methodId) { switch (methodId) {
@@ -187,7 +183,7 @@ public class InvocationMarshaller
callerOid, requestId, REQUEST_PROCESSED, new Object[] { result }, transport)); callerOid, requestId, REQUEST_PROCESSED, new Object[] { result }, transport));
} }
// documentation inherited @Override
public void dispatchResponse (int methodId, Object[] args) public void dispatchResponse (int methodId, Object[] args)
{ {
switch (methodId) { switch (methodId) {
@@ -240,9 +236,7 @@ public class InvocationMarshaller
} }
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[invOid=" + _invOid + ", code=" + _invCode + ", type=" + getClass().getName() + "]"; return "[invOid=" + _invOid + ", code=" + _invCode + ", type=" + getClass().getName() + "]";
@@ -114,7 +114,7 @@ public class AttributeChangedEvent extends NamedEvent
return ((Double)_value).doubleValue(); return ((Double)_value).doubleValue();
} }
@Override // from DEvent @Override
public boolean alreadyApplied () public boolean alreadyApplied ()
{ {
// if we have an old value, that means we're running on the master server and we have // 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); return (_oldValue != UNSET_OLD_VALUE);
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -184,7 +184,7 @@ public class AttributeChangedEvent extends NamedEvent
_oldValue = oldValue; _oldValue = oldValue;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof AttributeChangeListener) { if (listener instanceof AttributeChangeListener) {
@@ -192,7 +192,7 @@ public class AttributeChangedEvent extends NamedEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("CHANGE:"); buf.append("CHANGE:");
@@ -122,7 +122,7 @@ public class CompoundEvent extends DEvent
_events.clear(); _events.clear();
} }
@Override // from DEvent @Override
public void setSourceOid (int sourceOid) public void setSourceOid (int sourceOid)
{ {
super.setSourceOid(sourceOid); super.setSourceOid(sourceOid);
@@ -134,7 +134,7 @@ public class CompoundEvent extends DEvent
} }
} }
@Override // from DEvent @Override
public void setTargetOid (int targetOid) public void setTargetOid (int targetOid)
{ {
super.setTargetOid(targetOid); super.setTargetOid(targetOid);
@@ -146,7 +146,7 @@ public class CompoundEvent extends DEvent
} }
} }
@Override // from DEvent @Override
public void setTransport (Transport transport) public void setTransport (Transport transport)
{ {
super.setTransport(transport); super.setTransport(transport);
@@ -155,7 +155,7 @@ public class CompoundEvent extends DEvent
} }
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -174,7 +174,7 @@ public class CompoundEvent extends DEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("COMPOUND:"); buf.append("COMPOUND:");
@@ -162,9 +162,7 @@ public abstract class DEvent implements Streamable
// the default is to do nothing // the default is to do nothing
} }
/** @Override
* Constructs and returns a string representation of this event.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -409,14 +409,13 @@ public class DSet<E extends DSet.Entry>
/** /**
* Generates a shallow copy of this object. * Generates a shallow copy of this object.
*/ */
@Override
public Object clone () public Object clone ()
{ {
return typedClone(); return typedClone();
} }
/** @Override
* Generates a string representation of this set instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder("("); StringBuilder buf = new StringBuilder("(");
@@ -153,13 +153,13 @@ public class ElementUpdatedEvent extends NamedEvent
return ((Double)_value).doubleValue(); return ((Double)_value).doubleValue();
} }
@Override // from DEvent @Override
public boolean alreadyApplied () public boolean alreadyApplied ()
{ {
return (_oldValue != UNSET_OLD_VALUE); return (_oldValue != UNSET_OLD_VALUE);
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -191,7 +191,7 @@ public class ElementUpdatedEvent extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof ElementUpdateListener) { if (listener instanceof ElementUpdateListener) {
@@ -199,7 +199,7 @@ public class ElementUpdatedEvent extends NamedEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("UPDATE:"); buf.append("UPDATE:");
@@ -71,13 +71,13 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
return _entry; return _entry;
} }
@Override // from DEvent @Override
public boolean alreadyApplied () public boolean alreadyApplied ()
{ {
return _alreadyApplied; return _alreadyApplied;
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -89,7 +89,7 @@ public class EntryAddedEvent<T extends DSet.Entry> extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof SetListener) { 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) protected void toString (StringBuilder buf)
{ {
buf.append("ELADD:"); buf.append("ELADD:");
@@ -72,13 +72,13 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
return _oldEntry; return _oldEntry;
} }
@Override // from DEvent @Override
public boolean alreadyApplied () public boolean alreadyApplied ()
{ {
return (_oldEntry != UNSET_OLD_ENTRY); return (_oldEntry != UNSET_OLD_ENTRY);
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -95,7 +95,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof SetListener) { 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) protected void toString (StringBuilder buf)
{ {
buf.append("ELREM:"); buf.append("ELREM:");
@@ -90,13 +90,13 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
return _oldEntry; return _oldEntry;
} }
@Override // from DEvent @Override
public boolean alreadyApplied () public boolean alreadyApplied ()
{ {
return (_oldEntry != UNSET_OLD_ENTRY); return (_oldEntry != UNSET_OLD_ENTRY);
} }
@Override // from DEvent @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -114,7 +114,7 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof SetListener) { 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) protected void toString (StringBuilder buf)
{ {
buf.append("ELUPD:"); buf.append("ELUPD:");
@@ -107,9 +107,7 @@ public class InvocationNotificationEvent extends DEvent
return _args; return _args;
} }
/** @Override
* Applies this attribute change to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -117,13 +115,13 @@ public class InvocationNotificationEvent extends DEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
// nothing to do here // nothing to do here
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("INOT:"); buf.append("INOT:");
@@ -102,9 +102,7 @@ public class InvocationRequestEvent extends DEvent
return _args; return _args;
} }
/** @Override
* Applies this attribute change to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -112,13 +110,13 @@ public class InvocationRequestEvent extends DEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
// nothing to do here // nothing to do here
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("IREQ:"); buf.append("IREQ:");
@@ -102,9 +102,7 @@ public class InvocationResponseEvent extends DEvent
return _args; return _args;
} }
/** @Override
* Applies this attribute change to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -112,13 +110,13 @@ public class InvocationResponseEvent extends DEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
// nothing to do here // nothing to do here
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("IRSP:"); buf.append("IRSP:");
@@ -94,9 +94,7 @@ public class MessageEvent extends NamedEvent
_args = args; _args = args;
} }
/** @Override
* Applies this attribute change to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -104,7 +102,7 @@ public class MessageEvent extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof MessageListener) { if (listener instanceof MessageListener) {
@@ -112,7 +110,7 @@ public class MessageEvent extends NamedEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("MSG:"); buf.append("MSG:");
@@ -71,6 +71,7 @@ public abstract class NamedEvent extends DEvent
return _name; return _name;
} }
@Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
super.toString(buf); super.toString(buf);
@@ -63,9 +63,7 @@ public class ObjectAddedEvent extends NamedEvent
return _oid; return _oid;
} }
/** @Override
* Applies this event to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -74,7 +72,7 @@ public class ObjectAddedEvent extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof OidListListener) { if (listener instanceof OidListListener) {
@@ -82,7 +80,7 @@ public class ObjectAddedEvent extends NamedEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("OBJADD:"); buf.append("OBJADD:");
@@ -49,7 +49,7 @@ public class ObjectDestroyedEvent extends DEvent
{ {
} }
// documentation inherited @Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -58,7 +58,7 @@ public class ObjectDestroyedEvent extends DEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof ObjectDeathListener) { if (listener instanceof ObjectDeathListener) {
@@ -66,7 +66,7 @@ public class ObjectDestroyedEvent extends DEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("DESTROY:"); buf.append("DESTROY:");
@@ -64,9 +64,7 @@ public class ObjectRemovedEvent extends NamedEvent
return _oid; return _oid;
} }
/** @Override
* Applies this event to the object.
*/
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -75,7 +73,7 @@ public class ObjectRemovedEvent extends NamedEvent
return true; return true;
} }
// documentation inherited @Override
protected void notifyListener (Object listener) protected void notifyListener (Object listener)
{ {
if (listener instanceof OidListListener) { if (listener instanceof OidListListener) {
@@ -83,7 +81,7 @@ public class ObjectRemovedEvent extends NamedEvent
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("OBJREM:"); buf.append("OBJREM:");
@@ -133,6 +133,7 @@ public class OidList implements Streamable
return _oids[index]; return _oids[index];
} }
@Override
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@@ -54,7 +54,7 @@ public class ReleaseLockEvent extends NamedEvent
{ {
} }
// documentation inherited @Override
public boolean isPrivate () public boolean isPrivate ()
{ {
// we need only run on the server; no need to propagate to proxies // 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. * Applies this lock release to the object.
*/ */
@Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -73,6 +74,7 @@ public class ReleaseLockEvent extends NamedEvent
return false; return false;
} }
@Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
buf.append("UNLOCK:"); buf.append("UNLOCK:");
@@ -82,9 +82,7 @@ public class AuthRequest extends UpstreamMessage
return _bootGroups; return _bootGroups;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[type=AREQ, msgid=" + messageId + ", creds=" + _creds + return "[type=AREQ, msgid=" + messageId + ", creds=" + _creds +
@@ -66,6 +66,7 @@ public class AuthResponse extends DownstreamMessage
_data = data; _data = data;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=ARSP, msgid=" + messageId + ", data=" + _data + "]"; return "[type=ARSP, msgid=" + messageId + ", data=" + _data + "]";
@@ -52,6 +52,7 @@ public class BootstrapNotification extends DownstreamMessage
return _data; return _data;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=BOOT, msgid=" + messageId + ", data=" + _data + "]"; return "[type=BOOT, msgid=" + messageId + ", data=" + _data + "]";
@@ -71,13 +71,13 @@ public abstract class Credentials implements Streamable
return ""; return "";
} }
// documentation inherited @Override
public int hashCode () public int hashCode ()
{ {
return _username.hashCode(); return _username.hashCode();
} }
// documentation inherited @Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (other instanceof Credentials) { if (other instanceof Credentials) {
@@ -87,9 +87,7 @@ public abstract class Credentials implements Streamable
} }
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder("["); StringBuilder buf = new StringBuilder("[");
@@ -35,9 +35,7 @@ public abstract class DownstreamMessage extends Message
*/ */
public short messageId = -1; public short messageId = -1;
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[msgid=" + messageId + "]"; return "[msgid=" + messageId + "]";
@@ -59,6 +59,7 @@ public class EventNotification extends DownstreamMessage
return _event.getTransport(); return _event.getTransport();
} }
@Override
public String toString () public String toString ()
{ {
return "[type=EVT, evt=" + _event + "]"; return "[type=EVT, evt=" + _event + "]";
@@ -50,6 +50,7 @@ public class FailureResponse extends DownstreamMessage
return _message; return _message;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=FAIL, msgid=" + messageId + ", oid=" + _oid + ", msg=" + _message + "]"; return "[type=FAIL, msgid=" + messageId + ", oid=" + _oid + ", msg=" + _message + "]";
@@ -62,6 +62,7 @@ public class ForwardEventRequest extends UpstreamMessage
return _event.getTransport(); return _event.getTransport();
} }
@Override
public String toString () public String toString ()
{ {
return "[type=FWD, evt=" + _event + "]"; return "[type=FWD, evt=" + _event + "]";
@@ -31,6 +31,7 @@ public class LogoffRequest extends UpstreamMessage
super(); super();
} }
@Override
public String toString () public String toString ()
{ {
return "[type=LOGOFF, msgid=" + messageId + "]"; return "[type=LOGOFF, msgid=" + messageId + "]";
@@ -47,6 +47,7 @@ public class ObjectResponse<T extends DObject>
return _dobj; return _dobj;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=ORSP, msgid=" + messageId + ", obj=" + _dobj + "]"; return "[type=ORSP, msgid=" + messageId + ", obj=" + _dobj + "]";
@@ -105,6 +105,7 @@ public class PingRequest extends UpstreamMessage
return _transport; return _transport;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=PING, msgid=" + messageId + ", transport=" + _transport + "]"; return "[type=PING, msgid=" + messageId + ", transport=" + _transport + "]";
@@ -125,6 +125,7 @@ public class PongResponse extends DownstreamMessage
return _transport; return _transport;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=PONG, msgid=" + messageId + ", transport=" + _transport + "]"; return "[type=PONG, msgid=" + messageId + ", transport=" + _transport + "]";
@@ -48,6 +48,7 @@ public class SubscribeRequest extends UpstreamMessage
return _oid; return _oid;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=SUB, msgid=" + messageId + ", oid=" + _oid + "]"; return "[type=SUB, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -40,6 +40,7 @@ public class Transport
* and without duplicates. Functionally identical to UDP. * and without duplicates. Functionally identical to UDP.
*/ */
UNRELIABLE_UNORDERED(false, false) { UNRELIABLE_UNORDERED(false, false) {
@Override
public Type combine (Type other) { public Type combine (Type other) {
return other; // we defer to all 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. * order and without duplicates. In other words, out-of-order packets will be dropped.
*/ */
UNRELIABLE_ORDERED(false, true) { UNRELIABLE_ORDERED(false, true) {
@Override
public Type combine (Type other) { public Type combine (Type other) {
return other.isReliable() ? RELIABLE_ORDERED : this; return other.isReliable() ? RELIABLE_ORDERED : this;
} }
@@ -60,6 +62,7 @@ public class Transport
* order. * order.
*/ */
RELIABLE_UNORDERED(true, false) { RELIABLE_UNORDERED(true, false) {
@Override
public Type combine (Type other) { public Type combine (Type other) {
return other.isOrdered() ? RELIABLE_ORDERED : this; return other.isOrdered() ? RELIABLE_ORDERED : this;
} }
@@ -70,6 +73,7 @@ public class Transport
* Functionally identical to TCP. * Functionally identical to TCP.
*/ */
RELIABLE_ORDERED(true, true) { RELIABLE_ORDERED(true, true) {
@Override
public Type combine (Type other) { public Type combine (Type other) {
return this; // we override all return this; // we override all
} }
@@ -48,6 +48,7 @@ public class UnsubscribeRequest extends UpstreamMessage
return _oid; return _oid;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=UNSUB, msgid=" + messageId + ", oid=" + _oid + "]"; return "[type=UNSUB, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -49,6 +49,7 @@ public class UnsubscribeResponse extends DownstreamMessage
return _oid; return _oid;
} }
@Override
public String toString () public String toString ()
{ {
return "[type=UNACK, msgid=" + messageId + ", oid=" + _oid + "]"; return "[type=UNACK, msgid=" + messageId + ", oid=" + _oid + "]";
@@ -52,6 +52,7 @@ public abstract class UpstreamMessage extends Message
this.messageId = nextMessageId(); this.messageId = nextMessageId();
} }
@Override
public String toString () public String toString ()
{ {
return "[msgid=" + messageId + "]"; return "[msgid=" + messageId + "]";
@@ -47,19 +47,19 @@ public class UsernamePasswordCreds extends Credentials
return _password; return _password;
} }
@Override // documentation inherited @Override
public String getDatagramSecret () public String getDatagramSecret ()
{ {
return _password; return _password;
} }
// documentation inherited @Override
public int hashCode () public int hashCode ()
{ {
return super.hashCode() ^ _password.hashCode(); return super.hashCode() ^ _password.hashCode();
} }
// documentation inherited @Override
public boolean equals (Object other) public boolean equals (Object other)
{ {
if (other instanceof UsernamePasswordCreds) { if (other instanceof UsernamePasswordCreds) {
@@ -71,7 +71,7 @@ public class UsernamePasswordCreds extends Credentials
} }
} }
// documentation inherited @Override
protected void toString (StringBuilder buf) protected void toString (StringBuilder buf)
{ {
super.toString(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.AuthRequest;
import com.threerings.presents.net.AuthResponse; import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData; import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.Authenticator;
import com.threerings.presents.server.ChainedAuthenticator; import com.threerings.presents.server.ChainedAuthenticator;
import com.threerings.presents.server.net.AuthingConnection; 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 * bootstrap data classes that contain extra bootstrap information, if
* desired. * desired.
*/ */
@Override
protected BootstrapData createBootstrapData () protected BootstrapData createBootstrapData ()
{ {
return new PeerBootstrapData(); return new PeerBootstrapData();
@@ -67,6 +68,7 @@ public class PeerClient extends PresentsClient
* thread which means that object manipulations are OK, but client * thread which means that object manipulations are OK, but client
* instance manipulations must be done carefully. * instance manipulations must be done carefully.
*/ */
@Override
protected void populateBootstrapData (BootstrapData data) protected void populateBootstrapData (BootstrapData data)
{ {
super.populateBootstrapData(data); super.populateBootstrapData(data);
@@ -220,6 +220,7 @@ public abstract class PeerManager
_self = new NodeRecord( _self = new NodeRecord(
_nodeName, hostName, (publicHostName == null) ? hostName : publicHostName, port); _nodeName, hostName, (publicHostName == null) ? hostName : publicHostName, port);
_invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") { _invoker.postUnit(new WriteOnlyUnit("registerNode(" + _self + ")") {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
_noderepo.updateNode(_self); _noderepo.updateNode(_self);
} }
@@ -701,6 +702,7 @@ public abstract class PeerManager
// clear our record from the node table // clear our record from the node table
_invoker.postUnit(new WriteOnlyUnit("deleteNode(" + _nodeName + ")") { _invoker.postUnit(new WriteOnlyUnit("deleteNode(" + _nodeName + ")") {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
_noderepo.deleteNode(_nodeName); _noderepo.deleteNode(_nodeName);
} }
@@ -797,12 +799,14 @@ public abstract class PeerManager
{ {
// load up information on our nodes // load up information on our nodes
_invoker.postUnit(new RepositoryUnit("refreshPeers") { _invoker.postUnit(new RepositoryUnit("refreshPeers") {
@Override
public void invokePersist () throws Exception { public void invokePersist () throws Exception {
// let the world know that we're alive // let the world know that we're alive
_noderepo.heartbeatNode(_nodeName); _noderepo.heartbeatNode(_nodeName);
// then load up all the peer records // then load up all the peer records
_nodes = _noderepo.loadNodes(); _nodes = _noderepo.loadNodes();
} }
@Override
public void handleSuccess() { public void handleSuccess() {
for (NodeRecord record : _nodes) { for (NodeRecord record : _nodes) {
if (record.nodeName.equals(_nodeName)) { if (record.nodeName.equals(_nodeName)) {
@@ -815,6 +819,7 @@ public abstract class PeerManager
} }
} }
} }
@Override
public long getLongThreshold () { public long getLongThreshold () {
return 700L; return 700L;
} }
@@ -1011,6 +1016,7 @@ public abstract class PeerManager
// schedule a timeout to act if something goes wrong // schedule a timeout to act if something goes wrong
(_timeout = new Interval(_omgr) { (_timeout = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
log.warning("Lock handler timed out, acting anyway [lock=" + _lock + log.warning("Lock handler timed out, acting anyway [lock=" + _lock +
", acquire=" + _acquire + "]."); ", 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) // (this need not use a runqueue as all it will do is post an invoker unit)
protected Interval _peerRefresher = new Interval() { protected Interval _peerRefresher = new Interval() {
@Override
public void expired () { public void expired () {
refreshPeers(); refreshPeers();
} }
@@ -60,6 +60,7 @@ public class PeerNode
_omgr = omgr; _omgr = omgr;
_record = record; _record = record;
_client = new Client(null, _omgr) { _client = new Client(null, _omgr) {
@Override
protected void convertFromRemote (DObject target, DEvent event) { protected void convertFromRemote (DObject target, DEvent event) {
super.convertFromRemote(target, event); super.convertFromRemote(target, event);
// rewrite the event's target oid using the oid currently configured on the // rewrite the event's target oid using the oid currently configured on the
@@ -70,6 +71,7 @@ public class PeerNode
// properly deal with it // properly deal with it
event.eventId = PeerNode.this._omgr.getNextEventId(true); event.eventId = PeerNode.this._omgr.getNextEventId(true);
} }
@Override
protected Communicator createCommunicator () { protected Communicator createCommunicator () {
// TODO: make a custom communicator that uses the ClientManager NIO system to do // 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 // 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; this.nodeName = nodeName;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return StringUtil.fieldsToString(this); return StringUtil.fieldsToString(this);
@@ -26,7 +26,6 @@ import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker; import com.samskivert.util.Invoker;
import com.samskivert.util.ResultListener; import com.samskivert.util.ResultListener;
import com.threerings.presents.annotation.MainInvoker;
import com.threerings.presents.data.AuthCodes; import com.threerings.presents.data.AuthCodes;
import com.threerings.presents.net.AuthRequest; 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.net.AuthResponseData;
import com.threerings.presents.server.net.AuthingConnection; import com.threerings.presents.server.net.AuthingConnection;
import com.threerings.presents.server.net.ConnectionManager;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
/** /**
@@ -57,6 +54,7 @@ public abstract class Authenticator
final AuthResponse rsp = new AuthResponse(rdata); final AuthResponse rsp = new AuthResponse(rdata);
invoker.postUnit(new Invoker.Unit("authenticateConnection") { invoker.postUnit(new Invoker.Unit("authenticateConnection") {
@Override
public boolean invoke() { public boolean invoke() {
try { try {
processAuthentication(conn, rsp); processAuthentication(conn, rsp);
@@ -67,6 +65,7 @@ public abstract class Authenticator
return true; return true;
} }
@Override
public void handleResult () { public void handleResult () {
// stuff a reference to the auth response into the connection so that we have // stuff a reference to the auth response into the connection so that we have
// access to it later in the authentication process // 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.util.Name;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.net.AuthRequest; 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 // start up an interval that will check for expired clients and flush them from the bowels
// of the server // of the server
new Interval(_omgr) { new Interval(_omgr) {
@Override
public void expired () { public void expired () {
flushClients(); flushClients();
} }
@@ -32,8 +32,6 @@ import com.threerings.util.Name;
import com.threerings.presents.annotation.MainInvoker; import com.threerings.presents.annotation.MainInvoker;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.PermissionPolicy; 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 com.threerings.presents.dobj.RootDObjectManager;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
@@ -92,7 +90,7 @@ public class ClientResolver extends Invoker.Unit
_invoker.postUnit(this); _invoker.postUnit(this);
} }
// documentation inherited @Override
public boolean invoke () public boolean invoke ()
{ {
try { try {
@@ -105,7 +103,7 @@ public class ClientResolver extends Invoker.Unit
return true; return true;
} }
// documentation inherited @Override
public void handleResult () public void handleResult ()
{ {
// if we haven't failed, finish resolution on the dobj thread // 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 () public String toString ()
{ {
return "ClientResolver:" + _username; return "ClientResolver:" + _username;
@@ -23,8 +23,6 @@ package com.threerings.presents.server;
import com.samskivert.io.PersistenceException; import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.threerings.presents.net.AuthResponse; import com.threerings.presents.net.AuthResponse;
import com.threerings.presents.net.AuthResponseData; import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.server.net.AuthingConnection; import com.threerings.presents.server.net.AuthingConnection;
@@ -36,7 +34,7 @@ import static com.threerings.presents.Log.log;
*/ */
public class DummyAuthenticator extends Authenticator public class DummyAuthenticator extends Authenticator
{ {
// from abstract Authenticator @Override
protected void processAuthentication (AuthingConnection conn, AuthResponse rsp) protected void processAuthentication (AuthingConnection conn, AuthResponse rsp)
throws PersistenceException throws PersistenceException
{ {
@@ -43,8 +43,6 @@ import com.threerings.presents.dobj.DEvent;
import com.threerings.presents.dobj.DObject; import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.EventListener; import com.threerings.presents.dobj.EventListener;
import com.threerings.presents.dobj.InvocationRequestEvent; import com.threerings.presents.dobj.InvocationRequestEvent;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.net.Transport; import com.threerings.presents.net.Transport;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
@@ -75,13 +75,13 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
}; };
} }
// documentation inherited @Override
public synchronized boolean isDispatchThread () public synchronized boolean isDispatchThread ()
{ {
return EventQueue.isDispatchThread(); return EventQueue.isDispatchThread();
} }
// documentation inherited @Override
public void postEvent (final DEvent event) public void postEvent (final DEvent event)
{ {
EventQueue.invokeLater(new Runnable() { EventQueue.invokeLater(new Runnable() {
@@ -91,7 +91,7 @@ public class LocalDObjectMgr extends PresentsDObjectMgr
}); });
} }
// documentation inherited @Override
public void postRunnable (Runnable unit) public void postRunnable (Runnable unit)
{ {
// we just pass this right on to the AWT event queue rather than running them through // 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; return true;
} }
@Override
protected boolean registerHandlers () protected boolean registerHandlers ()
{ {
if (!SignalManager.servicesAvailable()) { if (!SignalManager.servicesAvailable()) {
@@ -807,9 +807,7 @@ public class PresentsClient
return false; return false;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
StringBuilder buf = new StringBuilder("["); StringBuilder buf = new StringBuilder("[");
@@ -29,7 +29,6 @@ import com.google.common.collect.Maps;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.samskivert.util.AuditLogger;
import com.samskivert.util.Histogram; import com.samskivert.util.Histogram;
import com.samskivert.util.IntMap; import com.samskivert.util.IntMap;
import com.samskivert.util.IntMaps; import com.samskivert.util.IntMaps;
@@ -845,11 +844,13 @@ public class PresentsDObjectMgr
_action = action; _action = action;
} }
@Override
public boolean isPrivate () public boolean isPrivate ()
{ {
return true; return true;
} }
@Override
public boolean applyToObject (DObject target) public boolean applyToObject (DObject target)
throws ObjectAccessException throws ObjectAccessException
{ {
@@ -930,6 +931,7 @@ public class PresentsDObjectMgr
return (this.reffingOid == reffingOid && this.field.equals(field)); return (this.reffingOid == reffingOid && this.field.equals(field));
} }
@Override
public String toString () public String toString ()
{ {
return "[reffingOid=" + reffingOid + ", field=" + field + return "[reffingOid=" + reffingOid + ", field=" + field +
@@ -947,6 +949,7 @@ public class PresentsDObjectMgr
_histo.addValue((int)elapsed); _histo.addValue((int)elapsed);
} }
@Override
public String toString () public String toString ()
{ {
int count = _histo.size(); int count = _histo.size();
@@ -21,8 +21,6 @@
package com.threerings.presents.server; package com.threerings.presents.server;
import java.util.Iterator;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Singleton; import com.google.inject.Singleton;
@@ -134,6 +132,7 @@ public class PresentsInvoker extends Invoker
protected class ShutdownUnit extends Unit protected class ShutdownUnit extends Unit
{ {
// run on the invoker thread // run on the invoker thread
@Override
public boolean invoke () public boolean invoke ()
{ {
if (checkLoops()) { if (checkLoops()) {
@@ -154,6 +153,7 @@ public class PresentsInvoker extends Invoker
} }
// run on the dobj thread // run on the dobj thread
@Override
public void handleResult () public void handleResult ()
{ {
if (checkLoops()) { if (checkLoops()) {
@@ -206,6 +206,7 @@ public class PresentsInvoker extends Invoker
// end the invoker thread // end the invoker thread
postUnit(new Unit() { postUnit(new Unit() {
@Override
public boolean invoke () { public boolean invoke () {
_running = false; _running = false;
return false; return false;
@@ -148,6 +148,7 @@ public abstract class RebootManager
_rebootSoon = false; _rebootSoon = false;
long firstWarnTime = (_nextReboot - (WARNINGS[0] * 60 * 1000)) - now; long firstWarnTime = (_nextReboot - (WARNINGS[0] * 60 * 1000)) - now;
_interval = new Interval(_omgr) { _interval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
doWarning(0); doWarning(0);
} }
@@ -238,6 +239,7 @@ public abstract class RebootManager
// wait 1 second, then do it // wait 1 second, then do it
new Interval() { // Note: This interval does not run on the dobj thread new Interval() { // Note: This interval does not run on the dobj thread
@Override
public void expired () { public void expired () {
// ...but we then post a LongRunnable... // ...but we then post a LongRunnable...
_omgr.postRunnable(new PresentsDObjectMgr.LongRunnable() { _omgr.postRunnable(new PresentsDObjectMgr.LongRunnable() {
@@ -265,6 +267,7 @@ public abstract class RebootManager
// schedule the next warning // schedule the next warning
_interval = new Interval(_omgr) { _interval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
doWarning(level + 1); doWarning(level + 1);
} }
@@ -287,6 +290,7 @@ public abstract class RebootManager
StringUtil.toString(_rebootLocks.elements())); StringUtil.toString(_rebootLocks.elements()));
broadcast("m.reboot_delayed"); broadcast("m.reboot_delayed");
_interval = new Interval(_omgr) { _interval = new Interval(_omgr) {
@Override
public void expired () { public void expired () {
doWarning(WARNINGS.length); doWarning(WARNINGS.length);
} }
@@ -26,12 +26,10 @@ import com.google.inject.Injector;
import com.samskivert.io.PersistenceException; import com.samskivert.io.PersistenceException;
import com.samskivert.util.Invoker;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.util.MessageBundle; import com.threerings.util.MessageBundle;
import com.threerings.presents.net.AuthResponse; 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.AuthingConnection;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
@@ -51,7 +49,7 @@ public class Rejector extends PresentsServer
} }
} }
// documentation inherited @Override
protected int[] getListenPorts () protected int[] getListenPorts ()
{ {
return _ports; return _ports;
@@ -87,7 +85,7 @@ public class Rejector extends PresentsServer
*/ */
protected class RejectingAuthenticator extends Authenticator protected class RejectingAuthenticator extends Authenticator
{ {
// from abstract Authenticator @Override
protected void processAuthentication (AuthingConnection conn, AuthResponse rsp) protected void processAuthentication (AuthingConnection conn, AuthResponse rsp)
throws PersistenceException throws PersistenceException
{ {
@@ -30,8 +30,6 @@ import com.samskivert.util.Interval;
import com.samskivert.util.RunQueue; import com.samskivert.util.RunQueue;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.annotation.EventQueue;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
/** /**
@@ -62,6 +60,7 @@ public class ReportManager
{ {
// queue up an interval which will generate reports // queue up an interval which will generate reports
_reportInterval = new Interval(rqueue) { _reportInterval = new Interval(rqueue) {
@Override
public void expired () { public void expired () {
logReport(generateReport(System.currentTimeMillis(), true)); logReport(generateReport(System.currentTimeMillis(), true));
} }
@@ -24,13 +24,12 @@ package com.threerings.presents.server;
import com.samskivert.util.RunAnywhere; import com.samskivert.util.RunAnywhere;
import com.samskivert.util.SignalUtil; import com.samskivert.util.SignalUtil;
import static com.threerings.presents.Log.log;
/** /**
* Handles signals using Sun's undocumented Signal class. * Handles signals using Sun's undocumented Signal class.
*/ */
public class SunSignalHandler extends AbstractSignalHandler public class SunSignalHandler extends AbstractSignalHandler
{ {
@Override
protected boolean registerHandlers () protected boolean registerHandlers ()
{ {
SignalUtil.register(SignalUtil.Number.TERM, new SignalUtil.Handler() { SignalUtil.register(SignalUtil.Number.TERM, new SignalUtil.Handler() {
@@ -22,8 +22,6 @@
package com.threerings.presents.server; package com.threerings.presents.server;
import java.util.HashMap; import java.util.HashMap;
import com.samskivert.util.ResultListener;
import com.threerings.presents.client.TimeBaseService.GotTimeBaseListener; import com.threerings.presents.client.TimeBaseService.GotTimeBaseListener;
import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.ClientObject;
@@ -32,8 +30,6 @@ import com.threerings.presents.data.TimeBaseObject;
import com.threerings.presents.dobj.RootDObjectManager; 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 * 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 * 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; _authrsp = authrsp;
} }
/** @Override
* Generates a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[mode=AUTHING, addr=" + return "[mode=AUTHING, addr=" +
@@ -36,7 +36,6 @@ import java.security.NoSuchAlgorithmException;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.io.ByteBufferInputStream; import com.threerings.io.ByteBufferInputStream;
import com.threerings.io.ByteBufferOutputStream;
import com.threerings.io.FramedInputStream; import com.threerings.io.FramedInputStream;
import com.threerings.io.FramingOutputStream; import com.threerings.io.FramingOutputStream;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
@@ -24,7 +24,6 @@ package com.threerings.presents.server.net;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.DatagramChannel; import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectableChannel; import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey; import java.nio.channels.SelectionKey;
@@ -52,7 +51,6 @@ import com.samskivert.util.Invoker;
import com.samskivert.util.LoopingThread; import com.samskivert.util.LoopingThread;
import com.samskivert.util.Queue; import com.samskivert.util.Queue;
import com.samskivert.util.ResultListener; import com.samskivert.util.ResultListener;
import com.samskivert.util.StringUtil;
import com.samskivert.util.Tuple; import com.samskivert.util.Tuple;
import com.threerings.io.FramingOutputStream; import com.threerings.io.FramingOutputStream;
@@ -281,7 +279,7 @@ public class ConnectionManager extends LoopingThread
} }
} }
// documentation inherited @Override
protected void willStart () protected void willStart ()
{ {
int successes = 0; int successes = 0;
@@ -414,6 +412,7 @@ public class ConnectionManager extends LoopingThread
/** /**
* Performs the select loop. This is the body of the conmgr thread. * Performs the select loop. This is the body of the conmgr thread.
*/ */
@Override
protected void iterate () protected void iterate ()
{ {
long iterStamp = System.currentTimeMillis(); long iterStamp = System.currentTimeMillis();
@@ -708,14 +707,14 @@ public class ConnectionManager extends LoopingThread
_stats.bytesOut += bytes; _stats.bytesOut += bytes;
} }
// documentation inherited @Override
protected void handleIterateFailure (Exception e) protected void handleIterateFailure (Exception e)
{ {
// log the exception // log the exception
log.warning("ConnectionManager.iterate() uncaught exception.", e); log.warning("ConnectionManager.iterate() uncaught exception.", e);
} }
// documentation inherited @Override
protected void didShutdown () protected void didShutdown ()
{ {
// take one last crack at the outgoing message queue // take one last crack at the outgoing message queue
@@ -1026,9 +1025,7 @@ public class ConnectionManager extends LoopingThread
_partial.flip(); _partial.flip();
} }
/** @Override
* Returns a string representation of this instance.
*/
public String toString () public String toString ()
{ {
return "[conn=" + conn + ", partials=" + _partials + ", msgs=" + _msgs + "]"; return "[conn=" + conn + ", partials=" + _partials + ", msgs=" + _msgs + "]";
@@ -51,6 +51,7 @@ public class RunningConnection extends Connection
{ {
} }
@Override
public String toString () public String toString ()
{ {
return "[mode=RUNNING, id=" + (hashCode() % 1000) + return "[mode=RUNNING, id=" + (hashCode() % 1000) +
@@ -975,6 +975,7 @@ public class ActionScriptSource
writer.flush(); writer.flush();
} }
@Override
public String toString () public String toString ()
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();

Some files were not shown because too many files have changed in this diff Show More