/** * Notifies on remove. Since listeners are never changed, this is thread safe. * * @param peerAddress The address of the removed peers */ private void notifyRemove(PeerAddress peerAddress) { statistics.triggerStatUpdate(false, size()); for (PeerMapChangeListener listener : peerMapChangeListeners) listener.peerRemoved(peerAddress); }
/** * Notifies on insert. Since listeners are never changed, this is thread safe. * * @param peerAddress The address of the inserted peers */ private void notifyInsert(PeerAddress peerAddress) { statistics.triggerStatUpdate(true, size()); for (PeerMapChangeListener listener : peerMapChangeListeners) listener.peerInserted(peerAddress); }