Packagecom.bourre.events
Classpublic class ApplicationBroadcaster
InheritanceApplicationBroadcaster Inheritance ChannelBroadcaster

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The 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 :

See also

ChannelBroadcaster.html
../plugin/ChannelExpert.html


Protected Properties
 PropertyDefined by
 Inherited_broadcasterClass : Class
ChannelBroadcaster
 Inherited_mChannel : HashMap
ChannelBroadcaster
 Inherited_oDefaultChannel : EventChannel
ChannelBroadcaster
Public Methods
 MethodDefined by
  
ApplicationBroadcaster(access:PrivateConstructorAccess)
Creates a new ApplicationBroadcaster object.
ApplicationBroadcaster
 Inherited
addEventListener(type:String, listener:Object, channel:EventChannel = null):Boolean
Adds an event listener for the specified event type of the specified channel.
ChannelBroadcaster
 Inherited
addListener(listener:Object, channel:EventChannel = null):Boolean
Adds the passed-in listener as listener for all events dispatched by this event channel broadcaster.
ChannelBroadcaster
 Inherited
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
 Inherited
empty():void
Clean the current channel broacaster by removing all Broadcaster instances previously created and then rebuild the default EventBroadcaster.
ChannelBroadcaster
  
getChannelDispatcher(channel:EventChannel = null, owner:Object = null):Broadcaster
Returns the EventBroadcaster object associated with the passed-in channel.
ApplicationBroadcaster
 Inherited
Returns a reference to the default channel of this channel broadcaster.
ChannelBroadcaster
 Inherited
Returns the Broadcaster implementation associated with the default channel of this channel broadcaster.
ChannelBroadcaster
  
[static] Returns the singleton instance of the ApplicationBroadcaster class.
ApplicationBroadcaster
 Inherited
Returns true if there is a Broadcaster instance registered for the passed-in channel.
ChannelBroadcaster
 Inherited
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
 Inherited
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
 Inherited
Removes the Broadcaster instance associated with the passed-in channel, and return true if there is a broadcaster and if it have been successfully removed.
ChannelBroadcaster
 Inherited
removeEventListener(type:String, listener:Object, channel:EventChannel = null):Boolean
Removes the passed-in listener for listening the specified event of the specified channel.
ChannelBroadcaster
 Inherited
removeListener(listener:Object, channel:EventChannel = null):Boolean
Removes the passed-in listener object from this event channel broadcaster.
ChannelBroadcaster
 Inherited
setDefaultChannel(channel:EventChannel = null):void
Defines which channel is used as default channel for this channel broadcaster.
ChannelBroadcaster
 Inherited
toString():String
Returns the string representation of this instance.
ChannelBroadcaster
Public Constants
 ConstantDefined 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
Constructor detail
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.

Parameters
access:PrivateConstructorAccess — a lock for direct instanciation of the ApplicationBroadcaster class
Method detail
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.

Parameters
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

Returns
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.

Returns
ApplicationBroadcaster — singleton instance of ApplicationBroadcaster
Constant detail
NO_CHANNELconstant
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_CHANNELconstant 
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.