예제 #1
0
 /** Delivers pending messages that satisfy the causality order criteria. */
 private void deliverPending() {
   ListIterator it = pending.listIterator();
   while (it.hasNext()) {
     EventContainer cont = (EventContainer) it.next();
     long[] VCx = cont.getVC();
     if (canDeliver(VCx)) {
       it.remove();
       GroupSendableEvent ev = cont.getEvent();
       try {
         ev.go();
       } catch (AppiaEventException e) {
         e.printStackTrace();
       }
       VC[ev.orig]++;
       if (!pending.isEmpty() && it.nextIndex() != 0) it = pending.listIterator();
     }
   }
 }
예제 #2
0
 /**
  * 合并
  *
  * @param list
  * @return
  */
 public List<EventBusListener> mergeList(List<EventBusListener> list) {
   List<EventBusListener> listAll = new ArrayList<EventBusListener>();
   if (list != null) {
     listAll.addAll(list);
   }
   List<EventBusListener> allAction =
       ec.getListeners(EventBusConfig.AllAction); // 如果有的action是属于allAction,则也会发送
   if (allAction != null) {
     listAll.addAll(allAction);
   }
   return listAll;
 }