Added Log facilities like we're used to, and discovered a host of
new wacky things (and possible compiler bugs) on the way. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3888 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
import flash.util.trace;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
@@ -9,6 +8,8 @@ import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.util.Comparable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
public /* abstract */ class DEvent
|
||||
implements Streamable
|
||||
{
|
||||
@@ -34,7 +35,8 @@ public /* abstract */ class DEvent
|
||||
*/
|
||||
public function applyToObject (target :DObject) :Boolean
|
||||
{
|
||||
trace("TODO: abstract methods?");
|
||||
// TODO
|
||||
Log.warning("DEvent.applyToTarget is really an abstract method.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.util.trace;
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import com.threerings.util.ClassUtil;
|
||||
import com.threerings.util.Comparable;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
public class DObject // extends EventDispatcher
|
||||
implements Streamable
|
||||
{
|
||||
@@ -53,7 +57,9 @@ public class DObject // extends EventDispatcher
|
||||
_listeners = new ArrayCollection();
|
||||
|
||||
} else if (_listeners.contains(listener)) {
|
||||
trace("Refusing repeat listener registration");
|
||||
Log.warning("Refusing repeat listener registration " +
|
||||
"[dobj=" + which() + ", list=" + listener + "].");
|
||||
Log.logStackTrace(new Error());
|
||||
return;
|
||||
}
|
||||
_listeners.addItem(listener);
|
||||
@@ -84,8 +90,9 @@ public class DObject // extends EventDispatcher
|
||||
listener.eventReceived(event);
|
||||
}
|
||||
} catch (e :Error) {
|
||||
trace("Listener choked during notification");
|
||||
trace(e.getStackTrace());
|
||||
Log.warning("Listener choked during notification " +
|
||||
"[list=" + listener + ", event=" + event + "].");
|
||||
Log.logStackTrace(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,10 +109,48 @@ public class DObject // extends EventDispatcher
|
||||
_omgr.postEvent(event);
|
||||
|
||||
} else {
|
||||
trace("Unable to post event, object has no omgr");
|
||||
Log.warning("Unable to post event, object has no omgr " +
|
||||
"[oid=" + getOid() + ", class=" + ClassUtil.getClassName(this) +
|
||||
", event=" + event + "].");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a concise string representation of this object.
|
||||
*/
|
||||
public function which () :String
|
||||
{
|
||||
var buf :StringBuilder = new StringBuilder();
|
||||
whichBuf(buf);
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to briefly describe this distributed object.
|
||||
*/
|
||||
public function whichBuf (buf :StringBuilder) :void
|
||||
{
|
||||
buf.append(ClassUtil.shortClassName(this), ":", _oid);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public function toString () :String
|
||||
{
|
||||
var buf :StringBuilder = new StringBuilder("[");
|
||||
toStringBuf(buf);
|
||||
buf.append("]");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string representation of this object.
|
||||
*/
|
||||
public function toStringBuf (buf :StringBuilder) :void
|
||||
{
|
||||
buf.append("oid=", _oid);
|
||||
}
|
||||
|
||||
public function startTransaction () :void
|
||||
{
|
||||
// TODO
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
import flash.util.trace;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.util.Comparable;
|
||||
import com.threerings.util.Comparable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
/**
|
||||
* The distributed set class provides a means by which an unordered set of
|
||||
@@ -161,7 +161,7 @@ public class DSet
|
||||
internal function add (elem :DSetEntry) :Boolean
|
||||
{
|
||||
if (contains(elem)) {
|
||||
trace("Refusing to add duplicate entry [set=" + this +
|
||||
Log.warning("Refusing to add duplicate entry [set=" + this +
|
||||
", entry=" + elem + "].");
|
||||
return false;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class DSet
|
||||
// documentation inherited from interface Streamable
|
||||
public function writeObject (out :ObjectOutputStream) :void
|
||||
{
|
||||
trace("TODO");
|
||||
Log.warning("TODO!");
|
||||
}
|
||||
|
||||
// documentation inherited from interface Streamable
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
import flash.util.trace;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
/**
|
||||
* An entry added event is dispatched when an entry is added to a {@link
|
||||
* DSet} attribute of a distributed entry. It can also be constructed to
|
||||
@@ -48,7 +49,7 @@ public class EntryAddedEvent extends NamedEvent
|
||||
{
|
||||
var added :Boolean = target[_name].add(_entry);
|
||||
if (!added) {
|
||||
trace("Duplicate entry found [event=" + this + "].");
|
||||
Log.warning("Duplicate entry found [event=" + this + "].");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
import flash.util.trace;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.util.Comparable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
/**
|
||||
* An entry removed event is dispatched when an entry is removed from a
|
||||
* {@link DSet} attribute of a distributed object. It can also be
|
||||
@@ -65,8 +66,8 @@ public class EntryRemovedEvent extends NamedEvent
|
||||
_oldEntry = dset.removeKey(_key);
|
||||
if (_oldEntry == null) {
|
||||
// complain if there was actually nothing there
|
||||
trace("No matching entry to remove [key=" + _key +
|
||||
", set=" + dset + "].");
|
||||
Log.warning("No matching entry to remove [key=" + _key +
|
||||
", set=" + dset + "].");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.trace;
|
||||
|
||||
import flash.util.StringBuilder;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
/**
|
||||
* An entry updated event is dispatched when an entry of a {@link DSet} is
|
||||
* updated. It can also be constructed to request the update of an entry
|
||||
@@ -64,7 +64,7 @@ public class EntryUpdatedEvent extends NamedEvent
|
||||
_oldEntry = dset.update(_entry);
|
||||
if (_oldEntry == null) {
|
||||
// complain if we didn't update anything
|
||||
trace("No matching entry to update [entry=" + this +
|
||||
Log.warning("No matching entry to update [entry=" + this +
|
||||
", set=" + dset + "].");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.threerings.presents.dobj {
|
||||
|
||||
import flash.util.trace;
|
||||
import flash.util.StringBuilder;
|
||||
|
||||
import com.threerings.io.Streamable;
|
||||
@@ -8,6 +7,8 @@ import com.threerings.io.Streamable;
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
/**
|
||||
* An oid list is used to store lists of object ids. The list will not
|
||||
* allow duplicate ids. This class is not synchronized, with the
|
||||
@@ -100,7 +101,7 @@ public class OidList
|
||||
// documentation inherited from interface Streamable
|
||||
public function writeObject (out :ObjectOutputStream) :void
|
||||
{
|
||||
trace("Not implemented");
|
||||
Log.warning("TODO: Not implemented: " + this);
|
||||
}
|
||||
|
||||
// documentation inherited from interface Streamable
|
||||
|
||||
Reference in New Issue
Block a user