Break success notification out into its own method. This lets me call it separately, and mastches reportFailure() quite elegantly besides.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6324 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2010-12-01 15:04:11 +00:00
parent be72e5cdad
commit 4c0224f835
@@ -125,16 +125,7 @@ public class ClientResolver extends Invoker.Unit
// 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);
try {
// add a reference for each listener
_clobj.reference();
crl.clientResolved(_username, _clobj);
} catch (Exception e) {
log.warning("Client resolution listener choked in clientResolved() " + crl, e);
}
}
reportSuccess();
} else {
// destroy the dangling user object
@@ -173,6 +164,23 @@ public class ClientResolver extends Invoker.Unit
// nothing to do by default
}
/**
* Reports success to our resolution listeners.
*/
protected void reportSuccess ()
{
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
ClientResolutionListener crl = _listeners.get(ii);
try {
// add a reference for each listener
_clobj.reference();
crl.clientResolved(_username, _clobj);
} catch (Exception e) {
log.warning("Client resolution listener choked in clientResolved() " + crl, e);
}
}
}
/**
* Reports failure to our resolution listeners.
*/