|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEvent<SourceClass,ListenerClass,PayloadClass>
Events are singletons that can register listeners and, when fired, notify the registered listeners by calling their callback methods. This is a generic interface that needs to be constrained by the implementing classes with the class of sources for which the event will be fired, the class of listeners bound to the event class and the class of the Payload object. Events and Listeners constitute the Extensible Event Framework
Method Summary | |
---|---|
void |
add(ListenerClass listener)
This method adds a new listener to the event. |
void |
fire(SourceClass source,
PayloadClass payload)
This method can be invoked to fire the EventCommand command for the source object. |
void |
remove(ListenerClass listener)
This method removes a listener from the event. |
Method Detail |
---|
void add(ListenerClass listener)
listener
- void remove(ListenerClass listener)
listener
- void fire(SourceClass source, PayloadClass payload)
source
- The object for which the event is being fired.payload
- The semantic content of the event, in a payload object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |