Class org.as2lib.env.event.broadcaster.SimpleConsumableEventBroadcaster

org.as2lib.core.BasicClass
   +--org.as2lib.env.event.SimpleEventListenerSource
      +--org.as2lib.env.event.broadcaster.SimpleConsumableEventBroadcaster

Implemented Interfaces

ConsumableEventBroadcaster

Description

SimpleConsumableEventBroadcaster broadcasts an event to listeners until the event has been consumed.

The dispatching of the event will be stopped as soon as the event is consumed. The event can be consumed by calling the appropriate method on the ConsumableEventInfo instance passed to the dispatch method and from there to the appropriate event method on the listeners.

Method Index

new SimpleConsumableEventBroadcaster()

dispatch()

Inherited from SimpleEventListenerSource

addAllListeners(), addListener(), getAllListeners(), hasListener(), removeAllListeners(), removeListener()

Inherited from BasicClass

toString()

Constructor Detail

SimpleConsumableEventBroadcaster

public function SimpleConsumableEventBroadcaster(listeners:Array)

Constructs a new SimpleConsumableEventBroadcaster instance.

Parameters

listeners(optional) an array of listeners to populate this broadcaster with

Method Detail

dispatch

public function dispatch(eventInfo:EventInfo):Void

Dispatches the passed-in eventInfo to all listeners until the event has been consumed.

The name returned by the EventInfo.getName method of the passed-in eventInfo is used as event method name to invoke on the listeners.

The passed-in eventInfo is also passed as parameter to the listeners' event methods.

The event dispatching will be stopped as soon as the event is consumed. An event can be consumed by calling the appropriate method on the passed-in eventInfo that must be, if the consumption of events shall be enabled, an instance of type ConsumableEventInfo.

Parameters

eventInfothe event to dispatch to all listeners

Throws

EventExecutionExceptionif a listener threw an exception during dispatching