|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IEventSource
An object that generates IEvent objects. The events are distributed
to IEventListener instances. The listeners need to be registered with
the source via the addListener(IEventListener) method.
| Method Summary | |
|---|---|
void |
addEvent(IEvent event)
Add the event to the source and notify any registered IEventListener instances with the event. |
boolean |
addListener(IEventListener listener)
Add the listener to the end of the list of listeners registered against this. |
byte |
getEventSourceGroupId()
A byte identifying the event source group id. |
List<IEventListener> |
getListeners()
Get the list of IEventListener instances observing this. |
boolean |
removeListener(IEventListener listener)
Remove the listener from the list of listeners registered against this. |
List<IEventListener> |
removeListeners()
Remove all listeners registered for receiving IEvent events
originating from this. |
| Methods inherited from interface fulmine.IDescriptor |
|---|
toDetailedString, toIdentityString |
| Methods inherited from interface fulmine.ILifeCycle |
|---|
isActive, start |
| Methods inherited from interface fulmine.IDestroyable |
|---|
destroy |
| Methods inherited from interface fulmine.IAddressable |
|---|
getAddress, getDomain, getIdentity, getType |
| Method Detail |
|---|
List<IEventListener> getListeners()
IEventListener instances observing this. The list
is the order of registration and the notification order for any
IEvent raised by this event source.
The list is not modifiable.
null if
there are no listenersboolean addListener(IEventListener listener)
IPriorityEventListener, it is added
to the beginning of the list.
Listeners are reference counted. Adding the same listener multiple times simply increments a reference count of the listener instance; if a listener is added twice, it must be removed twice for the listener instance reference to be removed from the internal list.
listener - the listener to add
true if the listener instance was added (there were
no reference counts for it), false if it already
existed (the reference count was incremented)boolean removeListener(IEventListener listener)
null.
Listeners are reference counted. When removing a listener, this method decrements the reference count until there are no more references, at which point the listener instance reference is actually removed.
listener - the listener to remove
true if the listener was found and the reference
count was 0 and it was removed, false otherwiseList<IEventListener> removeListeners()
IEvent events
originating from this.
byte getEventSourceGroupId()
EventProcessor that will distribute the events from this source.
EventProcessor servicing this.void addEvent(IEvent event)
IEventListener instances with the event. The manner of activating
listeners with the event may be synchronous or asynchronous; it is the
implementation that decides this.
event - the event to pass on to the registered listeners
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||