This content has been marked as final.
Show 5 replies
-
1. Re: implementation of PushEventListener
majeric Nov 14, 2008 1:27 AM (in response to majeric)anyone? I would realy need this, ASAP.
Thanks. -
2. Re: implementation of PushEventListener
nbelaevski Nov 14, 2008 11:56 AM (in response to majeric)Hi,
As you can see there are some other listeners that a4j:push component adds to event producer for its purposes. Implement addListener() method to hold a list of listeners, but not only the single listener of your type. -
3. Re: implementation of PushEventListener
majeric Nov 15, 2008 3:30 AM (in response to majeric)Implement addListener() method to hold a list of listeners, but not only the single listener of your type.
How should I do that? I would appreciate any quick example.
Thanks. -
4. Re: implementation of PushEventListener
nbelaevski Nov 16, 2008 8:17 AM (in response to majeric)Try this:
package test; import java.util.EventListener; import java.util.EventObject; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.ajax4jsf.event.PushEventListener; public class Test extends Thread { private List<PushEventListener> listeners = new CopyOnWriteArrayList<PushEventListener>(); public void addListener(EventListener listener) { listeners.add((PushEventListener) listener); } /* (non-Javadoc) * @see java.lang.Thread#run() */ @Override public void run() { super.run(); for (PushEventListener listener : listeners) { EventObject event = new EventObject(this); listener.onEvent(event); } } }
-
5. Re: implementation of PushEventListener
majeric Nov 17, 2008 1:52 AM (in response to majeric)OK. Thanks for help. I'll try this solution.
Uros