| Package | mx.messaging |
| Class | public class ChannelSet |
| Inheritance | ChannelSet EventDispatcher Object |
| Property | Defined by | ||
|---|---|---|---|
| channelIds : Array
[read-only]
The ids of the Channels used by the ChannelSet.
| ChannelSet | ||
| clustered : Boolean
[read-only]
Indicates whether the ChannelSet targets a clustered destination.
| ChannelSet | ||
| configured : Boolean
[read-only]
Indicates whether the ChannelSet is using automatically configured
Channels or manually assigned Channels.
| ChannelSet | ||
| connected : Boolean
[read-only]
Indicates whether the ChannelSet is connected.
| ChannelSet | ||
![]() | constructor : 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 this channel set.
| ChannelSet | ||
| messageAgents : Array
[read-only]
Provides access to the set of MessageAgents that use this ChannelSet.
| ChannelSet | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
| Method | Defined by | ||
|---|---|---|---|
|
Constructs a ChannelSet.
| ChannelSet | ||
|
Adds a Channel to the ChannelSet.
| ChannelSet | ||
![]() |
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 | ||
![]() |
Dispatches an event into the event flow.
| EventDispatcher | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | |
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
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 | ||
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
|
Removes a Channel from the ChannelSet.
| ChannelSet | ||
![]() |
Removes a listener from the EventDispatcher object.
| EventDispatcher | |
|
Sends a message from a MessageAgent over the currently connected Channel.
| ChannelSet | ||
|
Stores the credentials and passes them through to every connected channel.
| ChannelSet | ||
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
|
Returns the ids of the Channels in the ChannelSet.
| ChannelSet | ||
![]() |
Returns the primitive value of the specified object.
| Object | |
![]() |
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher | |
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | Dispatched when Flash Player 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 | |||
![]() | Dispatched when Flash Player loses operating system focus and is becoming inactive. | EventDispatcher | ||
| Dispatched when a property of the channel set changes. | ChannelSet | |||
| channelIds | property |
channelIds:Array [read-only]The ids of the Channels used by the ChannelSet.
Implementation public function get channelIds():Array
| clustered | property |
clustered:Boolean [read-only]Indicates whether the ChannelSet targets a clustered destination. If true, upon a successful connection the ChannelSet queries the destination for all clustered endpoints for its Channels and assigns these failover URIs to them.
Implementation public function get clustered():Boolean
| configured | property |
configured:Boolean [read-only]Indicates whether the ChannelSet is using automatically configured Channels or manually assigned Channels.
Implementation public function get configured():Boolean
| connected | property |
connected:Boolean [read-only]Indicates whether the ChannelSet is connected.
This property can be used as the source for data binding.
Implementation public function get connected():Boolean
| currentChannel | property |
currentChannel:Channel [read-only]Returns the current channel for this channel set.
Implementation public function get currentChannel():Channel
| messageAgents | property |
messageAgents:Array [read-only]Provides access to the set of MessageAgents that use this ChannelSet.
Implementation public function get messageAgents():Array
| ChannelSet | () | constructor |
public function ChannelSet(channelIds:Array = null, clustered:Boolean = false)
Constructs a ChannelSet.
If the channelIds argument is provided, the ChannelSet will
the specified Channels obtained via ServerConfig.getChannel()
to reach its destination.
Attempting to manually assign Channels to a ChannelSet that targets a
configured destination 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, after connecting over one of its channels the first time the ChannelSet will automatically request all of the endpoints across the cluster for each Channel in the set and assign these failover URIs to each respective Channel. This allows Channels in the ChannelSet to failover, and when failover is exhausted for a Channel the ChannelSet can advance to the next available Channel in the set.
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.
ParameterschannelIds:Array (default = null) — The ids of configured Channels for this ChannelSet to
use. If null, Channels must be manually added to the ChannelSet.
|
|
clustered:Boolean (default = false) — True if the Channels in the ChannelSet are clustered,
otherwise false.
|
| addChannel | () | method |
public function addChannel(channel:Channel):voidAdds a Channel to the ChannelSet.
Parameterschannel:Channel — The Channel to add.
|
IllegalOperationError — If the ChannelSet is
configured, adding a Channel is not supported.
|
| channelConnectHandler | () | method |
public function channelConnectHandler(event:ChannelEvent):voidHandles a CONNECT ChannelEvent and redispatches the event.
Parametersevent:ChannelEvent — The ChannelEvent.
|
| channelDisconnectHandler | () | method |
public function channelDisconnectHandler(event:ChannelEvent):voidHandles a DISCONNECT ChannelEvent and redispatches the event.
Parametersevent:ChannelEvent — The ChannelEvent.
|
| channelFaultHandler | () | method |
public function channelFaultHandler(event:ChannelFaultEvent):voidHandles a ChannelFaultEvent and redispatches the event.
Parametersevent:ChannelFaultEvent — The ChannelFaultEvent.
|
| connect | () | method |
public function connect(agent:MessageAgent):voidConnects a MessageAgent to the ChannelSet. Once connected, the agent can use the ChannelSet to send messages.
Parametersagent:MessageAgent — The MessageAgent to connect.
|
| disconnect | () | method |
public function disconnect(agent:MessageAgent):voidDisconnects a MessageAgent from the ChannelSet.
Parametersagent:MessageAgent — The MessageAgent to disconnect.
|
| logout | () | method |
public function logout(agent:MessageAgent):voidClears the stored credentials and calls logout on every channel in the set.
Parametersagent:MessageAgent — The MessageAgent that is initiating the logout.
|
| removeChannel | () | method |
public function removeChannel(channel:Channel):voidRemoves a Channel from the ChannelSet. If the Channel to remove is currently connected and being used by the ChannelSet, it is disconnected.
Parameterschannel:Channel — The Channel to remove.
|
IllegalOperationError — If the ChannelSet is
configured, removing a Channel is not supported.
|
| send | () | method |
public function send(agent:MessageAgent, message:IMessage):voidSends a message from a MessageAgent over the currently connected Channel.
Parametersagent:MessageAgent — The MessageAgent sending the message.
|
|
message:IMessage — The Message to send.
|
NoChannelAvailableError — If the ChannelSet has no internal
Channels to use.
|
| setCredentials | () | method |
public function setCredentials(credentials:String, agent:MessageAgent):voidStores the credentials and passes them through to every connected channel.
Parameterscredentials:String — The credentials for the MessageAgent.
|
|
agent:MessageAgent — The MessageAgent that is setting the credentials.
|
| toString | () | method |
public override function toString():StringReturns the ids of the Channels in the ChannelSet.
ReturnsString —
String representation of the ChannelSet.
|
| channelConnect | event |
mx.messaging.events.ChannelEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
channel | The channel that generated this event. |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The 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 | event |
mx.messaging.events.ChannelEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
channel | The channel that generated this event. |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The 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 | event |
mx.messaging.events.ChannelFaultEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
channel | The Channel that generated this event. |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
faultCode | Provides destination-specific details of the failure. |
faultDetail | Provides access to the destination-specific reason for the failure. |
faultString | Provides 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. |
target | The 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 | event |
mx.events.PropertyChangeEvent
mx.events.PropertyChangeEvent.PROPERTY_CHANGE
Dispatched when a property of the channel set 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:
| Property | Value |
|---|---|
bubbles | Determined by the constructor; defaults to false. |
cancelable | Determined by the constructor; defaults to false. |
kind | The kind of change; PropertyChangeEventKind.UPDATE or PropertyChangeEventKind.DELETE. |
oldValue | The original property value. |
newValue | The new property value, if any. |
property | The property that changed |
source | The object that contains the property that changed. |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The 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. |
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/201/langref/mx/messaging/ChannelSet.html