|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EventPublisher
Interface to publish events. It allows the decoupling of listeners which handle events and publishers which dispatch events.
annotation which can be used to indicate event listener methods| Method Summary | |
|---|---|
void |
publish(java.lang.Object event)
Publish an event that will be consumed by all listeners which have registered to receive it. |
void |
register(java.lang.Object listener)
Register a listener to receive events. |
void |
unregister(java.lang.Object listener)
Un-register a listener so that it will no longer receive events. |
void |
unregisterAll()
Un-register all listeners that this publisher knows about. |
| Method Detail |
|---|
void publish(java.lang.Object event)
EventListener and one argument which is assignable from the event type (i.e. a superclass
or interface implemented by the event object). Implementations may also dispatch events
to legacy EventListener implementations based on the types returned
from EventListener.getHandledEventClasses().
This method should process all event listeners, despite any errors or exceptions that are generated
as a result of dispatching the event.
event - the event to publish
java.lang.NullPointerException - if the event is nullvoid register(java.lang.Object listener)
EventListener annotation. Legacy
implementations may also support listeners which implement the now-deprecated
EventListener interface.
listener - The listener that is being registered
java.lang.NullPointerException - if the listener is null
java.lang.IllegalArgumentException - if the parameter is not found to be an actual listenerannotation which can be used to indicate event listener methodsvoid unregister(java.lang.Object listener)
listener - The listener to un-register
java.lang.NullPointerException - if the listener is nullvoid unregisterAll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||