Some widening.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4818 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-08-22 01:12:02 +00:00
parent 52be62ddbf
commit 9a150ebcda
2 changed files with 14 additions and 19 deletions
@@ -93,8 +93,7 @@ public class ClientDObjectMgr
public function subscribeToObject (oid :int, target :Subscriber) :void public function subscribeToObject (oid :int, target :Subscriber) :void
{ {
if (oid <= 0) { if (oid <= 0) {
target.requestFailed( target.requestFailed(oid, new ObjectAccessError("Invalid oid " + oid + "."));
oid, new ObjectAccessError("Invalid oid " + oid + "."));
} else { } else {
queueAction(oid, target, true); queueAction(oid, target, true);
} }
@@ -186,7 +185,7 @@ public class ClientDObjectMgr
} else if (obj is EventNotification) { } else if (obj is EventNotification) {
var evt :DEvent = obj.getEvent(); var evt :DEvent = obj.getEvent();
// log.info("Dispatch event: " + evt); // log.info("Dispatch event: " + evt);
dispatchEvent(evt); dispatchEvent(evt);
} else if (obj is ObjectResponse) { } else if (obj is ObjectResponse) {
@@ -195,8 +194,7 @@ public class ClientDObjectMgr
} else if (obj is UnsubscribeResponse) { } else if (obj is UnsubscribeResponse) {
var oid :int = obj.getOid(); var oid :int = obj.getOid();
if (_dead.remove(oid) == null) { if (_dead.remove(oid) == null) {
log.warning("Received unsub ACK from unknown object " + log.warning("Received unsub ACK from unknown object [oid=" + oid + "].");
"[oid=" + oid + "].");
} }
} else if (obj is FailureResponse) { } else if (obj is FailureResponse) {
@@ -302,23 +300,22 @@ public class ClientDObjectMgr
} }
/** /**
* Notifies the subscribers that had requested this object (for * Notifies the subscribers that had requested this object (for subscription) that it is not
* subscription) that it is not available. * available.
*/ */
protected function notifyFailure (oid :int) :void protected function notifyFailure (oid :int) :void
{ {
// let the penders know that the object is not available // let the penders know that the object is not available
var req :PendingRequest = (_penders.remove(oid) as PendingRequest); var req :PendingRequest = (_penders.remove(oid) as PendingRequest);
if (req == null) { if (req == null) {
log.warning("Failed to get object, but no one cares?! " + log.warning("Failed to get object, but no one cares?! [oid=" + oid + "].");
"[oid=" + oid + "].");
return; return;
} }
for (var ii :int = 0; ii < req.targets.length; ii++) { for (var ii :int = 0; ii < req.targets.length; ii++) {
var target :Subscriber = req.targets[ii]; var target :Subscriber = req.targets[ii];
// and let them know that the object is in // and let them know that the object is in
target.requestFailed(oid, null); target.requestFailed(oid, new ObjectAccessError("No such object " + oid + "."));
} }
} }
@@ -22,11 +22,10 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
/** /**
* An object access exception is delivered when an object is not * An object access exception is delivered when an object is not accessible to a requesting
* accessible to a requesting subscriber for some reason or other. For * subscriber for some reason or other. For some access exceptions, special derived classes exist
* some access exceptions, special derived classes exist to communicate * to communicate the error. For others, a message string explaining the access failure is
* the error. For others, a message string explaining the access failure * provided.
* is provided.
*/ */
public class ObjectAccessException extends Exception public class ObjectAccessException extends Exception
{ {
@@ -40,8 +39,8 @@ public class ObjectAccessException extends Exception
} }
/** /**
* Constructs a object access exception with the specified error * Constructs a object access exception with the specified error message and the chained
* message and the chained causing event. * causing event.
*/ */
public ObjectAccessException (String message, Exception cause) public ObjectAccessException (String message, Exception cause)
{ {
@@ -50,8 +49,7 @@ public class ObjectAccessException extends Exception
} }
/** /**
* Constructs a object access exception with the specified chained * Constructs a object access exception with the specified chained causing event.
* causing event.
*/ */
public ObjectAccessException (Exception cause) public ObjectAccessException (Exception cause)
{ {