Cleaned things up, fixed a years old bug. Now we will not get hosed if client
resolution fails for whatever reason and we will properly track our pending resolutions (not leaving them dangling if resolution failed) and do so more elegantly (by simply acting as a ClientResolutionObserver ourselves). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4239 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -105,21 +105,17 @@ public class ClientResolver extends Invoker.Unit
|
||||
// documentation inherited
|
||||
public void handleResult ()
|
||||
{
|
||||
// if we failed in invoke() report it here
|
||||
if (_failure != null) {
|
||||
// destroy the dangling user object
|
||||
PresentsServer.omgr.destroyObject(_clobj.getOid());
|
||||
|
||||
// let our listener know that we're hosed
|
||||
reportFailure(_failure);
|
||||
|
||||
} else {
|
||||
// otherwise, do more resolution goodness on the dobj thread
|
||||
finishResolution(_clobj);
|
||||
|
||||
// let the client manager know that we're all clear
|
||||
PresentsServer.clmgr.mapClientObject(_username, _clobj);
|
||||
// if we haven't failed, finish resolution on the dobj thread
|
||||
if (_failure == null) {
|
||||
try {
|
||||
finishResolution(_clobj);
|
||||
} catch (Exception e) {
|
||||
_failure = e;
|
||||
}
|
||||
}
|
||||
|
||||
// if we still haven't failed, then we're good to go
|
||||
if (_failure == null) {
|
||||
// and let the listeners in on the secret as well
|
||||
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
|
||||
ClientResolutionListener crl = _listeners.get(ii);
|
||||
@@ -134,6 +130,13 @@ public class ClientResolver extends Invoker.Unit
|
||||
Log.logStackTrace(e);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// destroy the dangling user object
|
||||
PresentsServer.omgr.destroyObject(_clobj.getOid());
|
||||
|
||||
// let our listener know that we're hosed
|
||||
reportFailure(_failure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user