Pacotemx.messaging
Classepublic class ChannelSet
HerançaChannelSet Inheritance EventDispatcher Inheritance Object

The ChannelSet is a set of Channels that are used to send messages to a target destination. The ChannelSet improves the quality of service on the client by hunting through its Channels to send messages in the face of network failures or individual Channel problems.

Default MXML Propertychannels



Propriedades Públicas
 PropriedadeDefinido por
  channelIds : Array
[read-only] The ids of the Channels used by the ChannelSet.
ChannelSet
  channels : Array
Provides access to the Channels in the ChannelSet.
ChannelSet
  clustered : Boolean
Indicates whether the ChannelSet targets a clustered destination.
ChannelSet
  connected : Boolean
[read-only] Indicates whether the ChannelSet is connected.
ChannelSet
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  currentChannel : Channel
[read-only] Returns the current Channel for the ChannelSet.
ChannelSet
  messageAgents : Array
[read-only] Provides access to the set of MessageAgents that use this ChannelSet.
ChannelSet
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Métodos Públicos
 MétodoDefinido por
  
ChannelSet(channelIds:Array = null, clusteredWithURLLoadBalancing:Boolean = false)
Constructs a ChannelSet.
ChannelSet
  
Adds a Channel to the ChannelSet.
ChannelSet
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
Handles a CONNECT ChannelEvent and redispatches the event.
ChannelSet
  
Handles a DISCONNECT ChannelEvent and redispatches the event.
ChannelSet
  
Handles a ChannelFaultEvent and redispatches the event.
ChannelSet
  
Connects a MessageAgent to the ChannelSet.
ChannelSet
  
Disconnects a MessageAgent from the ChannelSet.
ChannelSet
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Clears the stored credentials and calls logout on every channel in the set.
ChannelSet
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Removes a Channel from the ChannelSet.
ChannelSet
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
send(agent:MessageAgent, message:IMessage):void
Sends a message from a MessageAgent over the currently connected Channel.
ChannelSet
  
setCredentials(credentials:String, agent:MessageAgent, charset:String = null):void
Stores the credentials and passes them through to every connected channel.
ChannelSet
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Returns a String containing the ids of the Channels in the ChannelSet.
ChannelSet
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Eventos
 Evento Descrição Definido por
 Inherited Dispatched when Flash Player or the and AIR application gains operating system focus and becomes active.EventDispatcher
   Dispatched after a Channel in the ChannelSet has connected to its endpoint.ChannelSet
   Dispatched after a Channel in the ChannelSet has disconnected from its endpoint.ChannelSet
   Dispatched after a Channel in the ChannelSet has faulted.ChannelSet
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
   Dispatched when a property of the ChannelSet changes.ChannelSet
Detalhes da propriedade
channelIdspropriedade
channelIds:Array  [read-only]

The ids of the Channels used by the ChannelSet.


Implementação
    public function get channelIds():Array
channelspropriedade 
channels:Array  [read-write]

Provides access to the Channels in the ChannelSet. This property may be used to assign a set of channels at once or channels may be added directly to the ChannelSet via addChannel() individually. If this ChannelSet is configured automatically the individual channels are created lazily and added to this property as needed.


Implementação
    public function get channels():Array
    public function set channels(value:Array):void

Throws
IllegalOperationError — If the ChannelSet is configured, assigning to this property is not allowed.
clusteredpropriedade 
clustered:Boolean  [read-write]

Indicates whether the ChannelSet targets a clustered destination. If true, upon a successful connection the ChannelSet will query the destination for all clustered endpoints for its Channels and will assign failoverURIs to them. Channel ids are used to assign failoverURIs to the proper Channel instances so this requires that all Channels in the ChannelSet have non-null ids and an Error will be thrown when this property is set to true if this is not the case. If the ChannelSet is not using url load balancing on the client this property should not be set to true.


Implementação
    public function get clustered():Boolean
    public function set clustered(value:Boolean):void
connectedpropriedade 
connected:Boolean  [read-only]

Indicates whether the ChannelSet is connected.

This property can be used as the source for data binding.


Implementação
    public function get connected():Boolean
currentChannelpropriedade 
currentChannel:Channel  [read-only]

Returns the current Channel for the ChannelSet.


Implementação
    public function get currentChannel():Channel
messageAgentspropriedade 
messageAgents:Array  [read-only]

Provides access to the set of MessageAgents that use this ChannelSet.


Implementação
    public function get messageAgents():Array
Detalhes do construtor
ChannelSet()Construtor
public function ChannelSet(channelIds:Array = null, clusteredWithURLLoadBalancing:Boolean = false)

Constructs a ChannelSet. If the channelIds argument is provided, the ChannelSet will use automatically configured Channels obtained via ServerConfig.getChannel() to reach a destination. Attempting to manually assign Channels to a ChannelSet that uses configured Channels is not allowed.

If the channelIds argument is not provided or is null, Channels must be manually created and added to the ChannelSet in order to connect and send messages.

If the ChannelSet is clustered using url-load-balancing (where each server declares a unique RTMP or HTTP URL and the client fails over from one URL to the next), the first time that a Channel in the ChannelSet successfully connects the ChannelSet will automatically make a request for all of the endpoints across the cluster for all member Channels and will assign these failover URLs to each respective Channel. This allows Channels in the ChannelSet to failover individually, and when failover options for a specific Channel are exhausted the ChannelSet will advance to the next Channel in the set to attempt to reconnect.

Regardless of clustering, if a Channel cannot connect or looses connectivity, the ChannelSet will advance to its next available Channel and attempt to reconnect. This allows the ChannelSet to hunt through Channels that use different protocols, ports, etc., in search of one that can connect to its endpoint successfully.

Parâmetros
channelIds:Array (default = null) — The ids of configured Channels obtained from ServerConfig for this ChannelSet to use. If null, Channels must be manually added to the ChannelSet.
 
clusteredWithURLLoadBalancing:Boolean (default = false) — True if the Channels in the ChannelSet are clustered using url load balancing.
Detalhes do método
addChannel()método
public function addChannel(channel:Channel):void

Adds a Channel to the ChannelSet. A Channel with a null id cannot be added to the ChannelSet if the ChannelSet targets a clustered destination.

Parâmetros

channel:Channel — The Channel to add.


Throws
IllegalOperationError — If the ChannelSet is configured, adding a Channel is not supported. This error is also thrown if the ChannelSet's clustered property is true but the Channel has a null id.
channelConnectHandler()método 
public function channelConnectHandler(event:ChannelEvent):void

Handles a CONNECT ChannelEvent and redispatches the event.

Parâmetros

event:ChannelEvent — The ChannelEvent.

channelDisconnectHandler()método 
public function channelDisconnectHandler(event:ChannelEvent):void

Handles a DISCONNECT ChannelEvent and redispatches the event.

Parâmetros

event:ChannelEvent — The ChannelEvent.

channelFaultHandler()método 
public function channelFaultHandler(event:ChannelFaultEvent):void

Handles a ChannelFaultEvent and redispatches the event.

Parâmetros

event:ChannelFaultEvent — The ChannelFaultEvent.

connect()método 
public function connect(agent:MessageAgent):void

Connects a MessageAgent to the ChannelSet. Once connected, the agent can use the ChannelSet to send messages.

Parâmetros

agent:MessageAgent — The MessageAgent to connect.

disconnect()método 
public function disconnect(agent:MessageAgent):void

Disconnects a MessageAgent from the ChannelSet.

Parâmetros

agent:MessageAgent — The MessageAgent to disconnect.

logout()método 
public function logout(agent:MessageAgent):void

Clears the stored credentials and calls logout on every channel in the set.

Parâmetros

agent:MessageAgent — The MessageAgent that is initiating the logout.

removeChannel()método 
public function removeChannel(channel:Channel):void

Removes a Channel from the ChannelSet. If the Channel to remove is currently connected and being used by the ChannelSet, it is disconnected as well as removed.

Parâmetros

channel:Channel — The Channel to remove.


Throws
IllegalOperationError — If the ChannelSet is configured, removing a Channel is not supported.
send()método 
public function send(agent:MessageAgent, message:IMessage):void

Sends a message from a MessageAgent over the currently connected Channel.

Parâmetros

agent:MessageAgent — The MessageAgent sending the message.
 
message:IMessage — The Message to send.


Throws
NoChannelAvailableError — If the ChannelSet has no internal Channels to use.
setCredentials()método 
public function setCredentials(credentials:String, agent:MessageAgent, charset:String = null):void

Stores the credentials and passes them through to every connected channel.

Parâmetros

credentials:String — The credentials for the MessageAgent.
 
agent:MessageAgent — The MessageAgent that is setting the credentials.
 
charset:String (default = null) — The character set encoding used while encoding the credentials. The default is null, which implies the legacy encoding of ISO-Latin-1.


Throws
IllegalOperationError — in two situations; if credentials have already been set and an authentication is in progress with the remote detination, or if authenticated and the credentials specified don't match the currently authenticated credentials.
toString()método 
public override function toString():String

Returns a String containing the ids of the Channels in the ChannelSet.

Retorna
String — String representation of the ChannelSet.
Detalhes do evento
channelConnect Evento
Event Object Type: mx.messaging.events.ChannelEvent
ChannelEvent.type property = mx.messaging.events.ChannelEvent.CONNECT

Dispatched after a Channel in the ChannelSet has connected to its endpoint.

The CONNECT event type; indicates that the Channel connected to its endpoint.

The value of this constant is "channelConnect".

The properties of the event object have the following values:

PropriedadeValor
bubblesfalse
cancelablefalse
channelThe channel that generated this event.
currentTargetThe Object that defines the event listener that handles the event. For exemplo, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
reconnecting Indicates whether the channel that generated this event is reconnecting.
rejected Indicates whether the channel that generated this event was rejected. This would be true in the event that the channel has been disconnected due to inactivity and should not attempt to failover or connect on an alternate channel.
channelDisconnect Evento  
Event Object Type: mx.messaging.events.ChannelEvent
ChannelEvent.type property = mx.messaging.events.ChannelEvent.DISCONNECT

Dispatched after a Channel in the ChannelSet has disconnected from its endpoint.

The DISCONNECT event type; indicates that the Channel disconnected from its endpoint.

The value of this constant is "channelDisconnect".

The properties of the event object have the following values:

PropriedadeValor
bubblesfalse
cancelablefalse
channelThe channel that generated this event.
currentTargetThe Object that defines the event listener that handles the event. For exemplo, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
reconnecting Indicates whether the channel that generated this event is reconnecting.
rejected Indicates whether the channel that generated this event was rejected. This would be true in the event that the channel has been disconnected due to inactivity and should not attempt to failover or connect on an alternate channel.
channelFault Evento  
Event Object Type: mx.messaging.events.ChannelFaultEvent
ChannelFaultEvent.type property = mx.messaging.events.ChannelFaultEvent.FAULT

Dispatched after a Channel in the ChannelSet has faulted.

The FAULT event type; indicates that the Channel faulted.

The value of this constant is "channelFault".

The properties of the event object have the following values:

PropriedadeValor
bubblesfalse
cancelablefalse
channelThe Channel that generated this event.
currentTargetThe Object that defines the event listener that handles the event. For exemplo, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
faultCodeProvides destination-specific details of the failure.
faultDetailProvides access to the destination-specific reason for the failure.
faultStringProvides access to the underlying reason for the failure if the channel did not raise the failure itself.
reconnecting Indicates whether the channel that generated this event is reconnecting.
rootCause Provides access to the underlying reason for the failure if the channel did not raise the failure itself.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
propertyChange Evento  
Event Object Type: mx.events.PropertyChangeEvent
PropertyChangeEvent.type property = mx.events.PropertyChangeEvent.PROPERTY_CHANGE

Dispatched when a property of the ChannelSet changes.

The PropertyChangeEvent.PROPERTY_CHANGE constant defines the value of the type property of the event object for a PropertyChange event.

The properties of the event object have the following values:

PropriedadeValor
bubblesDetermined by the constructor; defaults to false.
cancelableDetermined by the constructor; defaults to false.
kindThe kind of change; PropertyChangeEventKind.UPDATE or PropertyChangeEventKind.DELETE.
oldValueThe original property value.
newValueThe new property value, if any.
propertyThe property that changed
sourceThe object that contains the property that changed.
currentTargetThe Object that defines the event listener that handles the event. For exemplo, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.