org.nutz.lang.util.LifeCycleWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.lang.util;
import java.util.ArrayList;
import java.util.List;
public class LifeCycleWrapper extends AbstractLifeCycle {
protected Object proxy;
protected List listeners = new ArrayList();
public LifeCycleWrapper(Object proxy) {
this.proxy = proxy;
}
public void trigger(Event event) throws Exception {
for (Listener listener : listeners)
if(!listener.trigger(proxy, event))
return;
}
public void addListener(Listener listener) {
this.listeners.add(listener);
}
public void clearListeners() {
this.listeners.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy