org.as2lib.core.BasicInterface +--org.as2lib.env.event.EventListenerSource +--org.as2lib.env.event.distributor.EventDistributorControl
EventDistributorControl
controls a distributor to distribute events to
listeners in a compiler-safe manner.
You can get a distributor via the getDistributor method that can be casted to your listener type. This enables you to distribute events in a compiler-safe manner.
addAllListeners(), addListener(), getAllListeners(), hasListener(), removeAllListeners(), removeListener()
public function getDistributor(Void)
Returns the typed distributor to distribute the event to all added listeners.
The returned distributor can be casted to the type all added listeners have. 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 checking.
Note that the type of the returned distributor depends on the concrete implementation of this interface. Most implementations will probably expect the listener type to be passed-in on construction.
the distributor to distribute the event
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