@Override public void addListener(Class<?> eventType, Object listener, Method method) { if (eventDispatcher == null) { eventDispatcher = SquirrelProvider.getInstance().newInstance(PolymEventDispatcher.class); } eventDispatcher.register(eventType, listener, method); }
@Override public void fireEvent(SquirrelEvent event) { if (eventDispatcher != null && isNotifiable()) { eventDispatcher.fireEvent(event); } }
@Override public void removeAllListeners() { if (eventDispatcher != null) eventDispatcher.unregisterAll(); }
@Override public void removeListener(Class<?> eventType, Object listener) { if (eventDispatcher != null) { eventDispatcher.unregister(eventType, listener); } }
@Override public int getListenerSize() { return eventDispatcher != null ? eventDispatcher.getListenerSize() : 0; }
public void removeListener(Predicate<ListenerMethod> predicate) { if (eventDispatcher != null) { eventDispatcher.unregister(predicate); } }