| java.lang.Object com.bigbross.bossa.notify.NotificationBus
NotificationBus | public class NotificationBus implements Serializable(Code) | | This class manages all event notifications inside Bossa. The events are
notified to listeners registered in the bus. This registration can happen
either at the bus creation or at a later time.
The listeners registered after the bus is created will not be preserved
if this bus is serialized. Due to this behaviour, objects outside the Bossa
core that are registered as listeners may lose notification of events if
a failure crashes the system.
author: BigBross Team |
Method Summary | |
Bossa | getBossa() Returns the bossa engine this notification bus is part. | public void | notifyEvent(Event event) Informs the occurrence of an event to all registered listeners. | public boolean | registerListener(Listener listener) Registers a new listener of the notification bus. | public void | removeListener(String id) Removes the listener from the notification bus, if present. |
NotificationBus | public NotificationBus(Bossa engine, List persistentListeners)(Code) | | Creates a new notification bus with some persistent listeners.
Parameters: engine - the bossa engine this notification bus is part. Parameters: persistentListeners - a list of the persistent listeners. |
NotificationBus | public NotificationBus(Bossa engine)(Code) | | Creates a new empty notification bus.
Parameters: engine - the bossa engine this notification bus is part. |
getBossa | Bossa getBossa()(Code) | | Returns the bossa engine this notification bus is part.
the bossa engine this notification bus is part. |
notifyEvent | public void notifyEvent(Event event)(Code) | | Informs the occurrence of an event to all registered listeners.
An event has an id and some attributes that are dependent on the event
type. See the constructor of the Event class for more
information.
Parameters: event - the event. See Also: com.bigbross.bossa.notify.Event.Event |
registerListener | public boolean registerListener(Listener listener)(Code) | | Registers a new listener of the notification bus.
Parameters: listener - the object that will act as a listener of thenotification bus. true if the listener is registered,false if there is already a listener registeredwith the same id. |
removeListener | public void removeListener(String id)(Code) | | Removes the listener from the notification bus, if present.
Parameters: id - the id of the listener. |
|
|