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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user