| Package | com.developmentarc.framework.utils |
| Class | public class EventBroker |
The EventBroker is a Static object which means that all access must be made through the static methods. The class is a facade Singleton which means that even though you are calling a static method a singleton object is defined so that only one instance of the EventBroker exists.
| Method | Defined by | ||
|---|---|---|---|
|
broadcast(event:Event):void
[static]
Called by an object that wishes to broadcast an event.
| EventBroker | ||
|
clearAllSubscriptions():void
[static]
Removes all subscribed methods and objects from the EventBroker.
| EventBroker | ||
|
subscribe(eventType:String, callback:Function):void
[static]
Enables any object to subscribe to any event type by providing the Event type and the callback method the EventBroker should call
when an Event of the requested type is broadcasted.
| EventBroker | ||
|
unsubscribe(eventType:String, callback:Function):void
[static]
Removes subscription of the specified event and callback.
| EventBroker | ||
| broadcast | () | method |
public static function broadcast(event:Event):voidCalled by an object that wishes to broadcast an event. All subscribers of the event type will be called and passed the provided Event.
Parametersevent:Event — The Event to broadcast to the subscriber set.
|
| clearAllSubscriptions | () | method |
public static function clearAllSubscriptions():voidRemoves all subscribed methods and objects from the EventBroker.
| subscribe | () | method |
public static function subscribe(eventType:String, callback:Function):voidEnables any object to subscribe to any event type by providing the Event type and the callback method the EventBroker should call when an Event of the requested type is broadcasted. The callback must be a single argument method that accepts type Event.
ParameterseventType:String — The Event type to subscribe to.
|
|
callback:Function — The method to call when the event type is broadcasted.
|
| unsubscribe | () | method |
public static function unsubscribe(eventType:String, callback:Function):voidRemoves subscription of the specified event and callback.
ParameterseventType:String |
|
callback:Function |