AbstractEventDistributorControl
offers default implementations of
methods needed when implementing the EventDistributorControl interface
or any sub-interface.
public function AbstractEventDistributorControl(listenerType:Function, checkListenerType:Boolean)
Constructs a new AbstractEventDistributorControl
instance.
checkListenerType
is by default set to true
.
listenerType | the expected type of listeners |
checkListenerType | determines whether to check that passed-in listeners are of the expected type |
IllegalArgumentException | if the passed-in listenerType is
null or undefined
|
public function getType(Void):Function
Returns the type of listeners this distributor expects. This is also the type of the distributor returned by the getDistributor method.
the type of the distributor and listeners
public function getDistributor(Void)
Returns the distributor to distribute the event to all added listeners.
The returned distributor can be casted to the type specified on construction. You can then invoke the event method on it to distribute it to all added listeners. This event distribution approach has the advantage of proper compile-time type-checking.
The returned distributor throws an EventExecutionException on distribution if an event method of a listener threw an exception.
This method does always return the same distributor.
the distributor to distribute the event