|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Event source interface implemented by all the repository
objects and MDRepository. Enables other objects
to register for listening to any repository events.
The objects that have to be registered for event
notifications need to implement MDRChangeListener
or MDRPreChangeListener
interface.
The repository distributes all the events recursively in the following way:
All the events are propagated recursively till they reach the repository object (e.g. each instance event is as a result of propagation always fired on the instance itself, on its class proxy, on its immediate package proxy, on all other package proxies containing the immediate package proxy to the outermost package proxy and at the end on the repository containing instance).
In addition, any event is fired only once for each listener (so no matter how many objects on the event's propagation path is a listener registered on - e.g. on both class proxy and its instances - it receives each notification only once per event).
Listeners may be added specifically for certain events only by calling
addListener(MDRChangeListener, int)
.
If instead addListener(MDRChangeListener)
is used for listener addition and, hence, no event mask is speficied, the listener
receives all events which are propagated to the source it is registered for.
Method Summary | |
void |
addListener(MDRChangeListener listener)
Registers a listener for receiving all event notifications. |
void |
addListener(MDRChangeListener listener,
int mask)
Registers a listener for receiving notifications about events the type of which matches mask . |
void |
removeListener(MDRChangeListener listener)
Removes listener from the list of objects registered for events notifications. |
void |
removeListener(MDRChangeListener listener,
int mask)
Removes listener only for events of types matching mask . |
Method Detail |
public void addListener(MDRChangeListener listener)
listener
- Object that implements MDRChangeListener
interface.public void addListener(MDRChangeListener listener, int mask)
mask
.
listener
- Object that implements MDRChangeListener
interface.mask
- bitmask to be used in a call to MDRChangeEvent.isOfType(int)
to filter events based on the mask. The masks are defined in MDRChangeEvent
and the interfaces that extend it.public void removeListener(MDRChangeListener listener)
listener
- Object that implements MDRChangeListener
interface.public void removeListener(MDRChangeListener listener, int mask)
mask
.
If a listener is additionally registered for events of other types, it
proceeds listening on the remaining event types.
listener
- Object that implements MDRChangeListener
interface.mask
- determines the types of events the listener shall stop
to listen on. The masks are defined in MDRChangeEvent
and the interfaces that extend it.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |