예제 #1
0
파일: PeerMap.java 프로젝트: xzqttt/TomP2P
 /**
  * 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);
 }
예제 #2
0
파일: PeerMap.java 프로젝트: xzqttt/TomP2P
 /**
  * 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);
 }