Esempio n. 1
0
 public synchronized void unregisterListener(EventListener listener) {
   Iterator<EventSender> i = eventSenders.iterator();
   while (i.hasNext()) {
     EventSender sender = i.next();
     sender.unregisterListener(listener);
     if (sender.getListeners().isEmpty()) i.remove();
   }
 }
Esempio n. 2
0
 public synchronized List<EventListener> getListeners(Class<? extends Event> eventClass) {
   for (EventSender sender : eventSenders)
     if (eventClass.isAssignableFrom(sender.getListenerEventClass())) return sender.getListeners();
   return Collections.emptyList();
 }