| Package | com.bourre.events |
| Class | public class ApplicationBroadcaster |
| Inheritance | ApplicationBroadcaster ChannelBroadcaster |
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
ApplicationBroadcaster class is a singleton
implementation of the ChannelBroadcaster class,
used for Inversion of Controls purpose. More formally
the application broadcaster is dedicated to plugin to plugin
communication. When defining a plugin with a specific channel,
and then listeners of this plugin, a channel instance is created
in the ChannelExpert and then this channel is used
in order to create the whole dispatching stuff between these
plugins.
The class defines two constant channels dedicated to an IoC usage. These channel represents particular behaviors of the application broadcaster. Such :
NO_CHANNEL : That constant, when used as argument of
the getChannelDispatcher method, force the application
broadcaster to ignore the call. No broadcaster will be created and
then returned by the function.SYSTEM_CHANNEL : Defines the default channel of the
application broadcaster singleton. All objects which add themselves
as listener without specifying any channel are considered as system
listeners.See also
| Method | Defined by | ||
|---|---|---|---|
|
ApplicationBroadcaster(access:PrivateConstructorAccess)
Creates a new
ApplicationBroadcaster object. | ApplicationBroadcaster | ||
![]() |
addEventListener(type:String, listener:Object, channel:EventChannel = null):Boolean
Adds an event listener for the specified event type of the
specified channel.
| ChannelBroadcaster | |
![]() |
addListener(listener:Object, channel:EventChannel = null):Boolean
Adds the passed-in listener as listener for all events
dispatched by this event channel broadcaster.
| ChannelBroadcaster | |
![]() |
broadcastEvent(e:Event, channel:EventChannel = null):void
Broadcast the passed-in event object to listeners
according to the event's type and
channel
argument. | ChannelBroadcaster | |
![]() |
empty():void
Clean the current channel broacaster by removing all
Broadcaster instances previously created
and then rebuild the default EventBroadcaster. | ChannelBroadcaster | |
|
Returns the
EventBroadcaster object associated with
the passed-in channel | ApplicationBroadcaster | ||
![]() |
Returns a reference to the default channel of this
channel broadcaster.
| ChannelBroadcaster | |
![]() |
Returns the
Broadcaster implementation associated
with the default channel of this channel broadcaster. | ChannelBroadcaster | |
|
[static]
Returns the singleton instance of the
ApplicationBroadcaster
class. | ApplicationBroadcaster | ||
![]() |
hasChannelDispatcher(channel:EventChannel):Boolean
Returns
true if there is a Broadcaster
instance registered for the passed-in channel. | ChannelBroadcaster | |
![]() |
hasChannelListener(type:String, channel:EventChannel = null):Boolean
Returns
true if there is a Broadcaster instance
registered for the passed-in channel, and if this broadcaster has registered
listeners. | ChannelBroadcaster | |
![]() |
isRegistered(listener:Object, type:String, channel:EventChannel):Boolean
Returns
true if the passed-in listener
is registered as listener for the passed-in event type
in the passed-in channel. | ChannelBroadcaster | |
![]() |
releaseChannelDispatcher(channel:EventChannel):Boolean
Removes the
Broadcaster instance associated with
the passed-in channel | ChannelBroadcaster | |
![]() |
removeEventListener(type:String, listener:Object, channel:EventChannel = null):Boolean
Removes the passed-in listener for listening the specified event of
the specified channel.
| ChannelBroadcaster | |
![]() |
removeListener(listener:Object, channel:EventChannel = null):Boolean
Removes the passed-in listener object from this event
channel broadcaster.
| ChannelBroadcaster | |
![]() |
setDefaultChannel(channel:EventChannel = null):void
Defines which channel is used as default channel for this
channel broadcaster.
| ChannelBroadcaster | |
![]() |
toString():String
Returns the string representation of this instance.
| ChannelBroadcaster | |
| Constant | Defined by | ||
|---|---|---|---|
| NO_CHANNEL : EventChannel
Inhibit the behavior of the
getChannelDispatcher
which will return nothing if this channel is passed as argument. | ApplicationBroadcaster | ||
| SYSTEM_CHANNEL : EventChannel
Default channel for the application broadcaster, all listeners
which not define any channel are considered as system listeners.
| ApplicationBroadcaster | ||
| ApplicationBroadcaster | () | constructor |
public function ApplicationBroadcaster(access:PrivateConstructorAccess)
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Creates a new ApplicationBroadcaster object. This constructor
is locked using a simple hack, you cannot call the constructor directly.
Please use the ApplicationBroadcaster.getInstance method instead,
in order to retreive the singleton instance of the class.
access:PrivateConstructorAccess — a lock for direct instanciation of the
ApplicationBroadcaster class
|
| getChannelDispatcher | () | method |
public override function getChannelDispatcher(channel:EventChannel = null, owner:Object = null):Broadcaster
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the EventBroadcaster object associated with
the passed-in channel. The owner is an optionnal
parameter which is used to initialize the newly created EventBroadcaster
when there is no broadcaster for this channel.
There's a particular case defined by this class, when passing the NO_CHANNEL
channel in this function, the function will return null instead of a broadcaster.
channel:EventChannel (default = null) — the channel for which get the associated broadcaster
|
|
owner:Object (default = null) — an optional object which will used as source if there
is no broadcaster associated to the channel
|
Broadcaster —
the EventBroadcaster object associated with
the passed-in channel |
| getInstance | () | method |
public static function getInstance():ApplicationBroadcaster
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the singleton instance of the ApplicationBroadcaster
class. The class instance is created using the lazy initialisation concept.
ApplicationBroadcaster —
singleton instance of ApplicationBroadcaster
|
| NO_CHANNEL | constant |
public const NO_CHANNEL:EventChannel
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Inhibit the behavior of the getChannelDispatcher
which will return nothing if this channel is passed as argument.
| SYSTEM_CHANNEL | constant |
public const SYSTEM_CHANNEL:EventChannel
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Default channel for the application broadcaster, all listeners which not define any channel are considered as system listeners.