Use the convenience creation methods on ObserverList
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6604 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -44,7 +44,7 @@ public class BasicDirector extends EventDispatcher
|
|||||||
{
|
{
|
||||||
// save context
|
// save context
|
||||||
_ctx = ctx;
|
_ctx = ctx;
|
||||||
|
|
||||||
// listen for session start and end
|
// listen for session start and end
|
||||||
var client :Client = ctx.getClient();
|
var client :Client = ctx.getClient();
|
||||||
client.addClientObserver(this);
|
client.addClientObserver(this);
|
||||||
|
|||||||
@@ -1463,12 +1463,10 @@ public class ChatDirector extends BasicDirector
|
|||||||
protected boolean _mogrifyChat= true;
|
protected boolean _mogrifyChat= true;
|
||||||
|
|
||||||
/** A list of registered chat displays. */
|
/** A list of registered chat displays. */
|
||||||
protected ObserverList<ChatDisplay> _displays =
|
protected ObserverList<ChatDisplay> _displays = ObserverList.newSafeInOrder();
|
||||||
new ObserverList<ChatDisplay>(ObserverList.SAFE_IN_ORDER_NOTIFY);
|
|
||||||
|
|
||||||
/** A list of registered chat filters. */
|
/** A list of registered chat filters. */
|
||||||
protected ObserverList<ChatFilter> _filters =
|
protected ObserverList<ChatFilter> _filters = ObserverList.newSafeInOrder();
|
||||||
new ObserverList<ChatFilter>(ObserverList.SAFE_IN_ORDER_NOTIFY);
|
|
||||||
|
|
||||||
/** A mapping from auxiliary chat objects to the types under which
|
/** A mapping from auxiliary chat objects to the types under which
|
||||||
* they are registered. */
|
* they are registered. */
|
||||||
@@ -1481,8 +1479,7 @@ public class ChatDirector extends BasicDirector
|
|||||||
protected LinkedList<Name> _chatters = new LinkedList<Name>();
|
protected LinkedList<Name> _chatters = new LinkedList<Name>();
|
||||||
|
|
||||||
/** Observers that are watching our chatters list. */
|
/** Observers that are watching our chatters list. */
|
||||||
protected ObserverList<ChatterObserver> _chatterObservers =
|
protected ObserverList<ChatterObserver> _chatterObservers = ObserverList.newSafeInOrder();
|
||||||
new ObserverList<ChatterObserver>(ObserverList.SAFE_IN_ORDER_NOTIFY);
|
|
||||||
|
|
||||||
/** Operation used to filter chat messages. */
|
/** Operation used to filter chat messages. */
|
||||||
protected FilterMessageOp _filterMessageOp = new FilterMessageOp();
|
protected FilterMessageOp _filterMessageOp = new FilterMessageOp();
|
||||||
|
|||||||
@@ -189,6 +189,5 @@ public class MuteDirector extends BasicDirector
|
|||||||
protected HashSet<Name> _mutelist = Sets.newHashSet();
|
protected HashSet<Name> _mutelist = Sets.newHashSet();
|
||||||
|
|
||||||
/** List of mutelist observers. */
|
/** List of mutelist observers. */
|
||||||
protected ObserverList<MuteObserver> _observers =
|
protected ObserverList<MuteObserver> _observers = ObserverList.newFastUnsafe();
|
||||||
new ObserverList<MuteObserver>(ObserverList.FAST_UNSAFE_NOTIFY);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -580,8 +580,7 @@ public class LocationDirector extends BasicDirector
|
|||||||
protected LocationService _lservice;
|
protected LocationService _lservice;
|
||||||
|
|
||||||
/** Our location observer list. */
|
/** Our location observer list. */
|
||||||
protected ObserverList<LocationObserver> _observers = new ObserverList<LocationObserver>(
|
protected ObserverList<LocationObserver> _observers = ObserverList.newSafeInOrder();
|
||||||
ObserverList.SAFE_IN_ORDER_NOTIFY);
|
|
||||||
|
|
||||||
/** Used to subscribe to our place object. */
|
/** Used to subscribe to our place object. */
|
||||||
protected SafeSubscriber<PlaceObject> _subber;
|
protected SafeSubscriber<PlaceObject> _subber;
|
||||||
|
|||||||
@@ -875,7 +875,7 @@ public abstract class PeerManager
|
|||||||
{
|
{
|
||||||
ObserverList<StaleCacheObserver> list = _cacheobs.get(cache);
|
ObserverList<StaleCacheObserver> list = _cacheobs.get(cache);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ObserverList<StaleCacheObserver>(ObserverList.FAST_UNSAFE_NOTIFY);
|
list = ObserverList.newFastUnsafe();
|
||||||
_cacheobs.put(cache, list);
|
_cacheobs.put(cache, list);
|
||||||
}
|
}
|
||||||
list.add(observer);
|
list.add(observer);
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ public class ClientManager
|
|||||||
{
|
{
|
||||||
_clobservers.remove(observer);
|
_clobservers.remove(observer);
|
||||||
if (observer instanceof DetailedClientObserver) {
|
if (observer instanceof DetailedClientObserver) {
|
||||||
_dclobservers.remove(observer);
|
_dclobservers.remove((DetailedClientObserver)observer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,15 +265,15 @@ public class ClientManager
|
|||||||
public void clientResolved (Name username, ClientObject clobj) {
|
public void clientResolved (Name username, ClientObject clobj) {
|
||||||
try {
|
try {
|
||||||
clop.apply(clobj);
|
clop.apply(clobj);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warning("Client op failed", "username", username, "clop", clop, e);
|
log.warning("Client op failed", "username", username, "clop", clop, e);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
releaseClientObject(username);
|
releaseClientObject(username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resolutionFailed (Name username, Exception reason) {
|
public void resolutionFailed (Name username, Exception reason) {
|
||||||
clop.resolutionFailed(reason);
|
clop.resolutionFailed(reason);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user