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(); } }
public synchronized List<EventListener> getListeners(Class<? extends Event> eventClass) { for (EventSender sender : eventSenders) if (eventClass.isAssignableFrom(sender.getListenerEventClass())) return sender.getListeners(); return Collections.emptyList(); }