Apache Flex 4.16.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
PollingChannel

Package | mx.messaging.channels
Class | public class PollingChannel
Inheritance | PollingChannel Channel flash.events.EventDispatcher
Subclasses | HTTPChannel, NetConnectionChannel

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

The PollingChannel class provides the polling behavior that all polling channels in the messaging system require.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | authenticated : Boolean [read-only] Indicates if this channel is authenticated. | Channel
|  | channelSets : Array [read-only] Provides access to the ChannelSets connected to the Channel. | Channel
|  | connected : Boolean [read-only] Indicates whether this channel has established a connection to the remote destination. | Channel
|  | connectTimeout : int Provides access to the connect timeout in seconds for the channel. | Channel
|  | endpoint : String [read-only] Provides access to the endpoint for this channel. | Channel
|  | failoverURIs : Array Provides access to the set of endpoint URIs that this channel can attempt to failover to if the endpoint is clustered. | Channel
|  | id : String Provides access to the id of this channel. | Channel
|  | protocol : String [read-only] Provides access to the protocol that the channel uses. | Channel
|  | reconnecting : Boolean [read-only] Indicates whether this channel is in the process of reconnecting to an alternate endpoint. | Channel
|  | recordMessageSizes : Boolean [read-only] Channel property determines the level of performance information injection - whether we inject message sizes or not. | Channel
|  | recordMessageTimes : Boolean [read-only] Channel property determines the level of performance information injection - whether we inject timestamps or not. | Channel
|  | requestTimeout : int Provides access to the default request timeout in seconds for the channel. | Channel
|  | uri : String Provides access to the URI used to create the whole endpoint URI for this channel. | Channel

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | shouldBeConnected : Boolean [read-only] Indicates whether this channel should be connected to its endpoint. | Channel

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | PollingChannel(id:String = null, uri:String = null) Creates a new PollingChannel instance with the specified id. | PollingChannel
|  | applySettings(settings:XML):void Subclasses should override this method to apply any settings that may be necessary for an individual channel. | Channel
|  | connect(channelSet:ChannelSet):void Connects the ChannelSet to the Channel. | Channel
|  | disablePolling():void Disables polling based on the number of times enablePolling() and disablePolling() have been invoked. | PollingChannel
|  | disconnect(channelSet:ChannelSet):void Disconnects the ChannelSet from the Channel. | Channel
|  | enablePolling():void Enables polling based on the number of times enablePolling() and disablePolling() have been invoked. | PollingChannel
|  | logout(agent:MessageAgent):void Sends a CommandMessage to the server to logout if the Channel is connected. | Channel
|  | poll():void Initiates a poll operation if there are consumers subscribed to this channel, and polling is enabled for this channel. | PollingChannel
|  | send(agent:MessageAgent, message:IMessage):void [override] Sends the specified message to its target destination. | PollingChannel
|  | setCredentials(credentials:String, agent:MessageAgent = null, charset:String = null):void Sets the credentials to the specified value. | Channel

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | applyClientLoadBalancingSettings(props:XML):void Applies the client load balancing urls if they exists. | Channel
|  | connectFailed(event:ChannelFaultEvent):void Processes a failed internal connect and dispatches the FAULT event for the channel. | Channel
|  | connectSuccess():void Processes a successful internal connect and dispatches the CONNECT event for the Channel. | Channel
|  | connectTimeoutHandler(event:TimerEvent):void Handles a connect timeout by dispatching a ChannelFaultEvent. | Channel
|  | disconnectFailed(event:ChannelFaultEvent):void Processes a failed internal disconnect and dispatches the FAULT event for the channel. | Channel
|  | disconnectSuccess(rejected:Boolean = false):void Processes a successful internal disconnect and dispatches the DISCONNECT event for the Channel. | Channel
|  | flexClientWaitHandler(event:PropertyChangeEvent):void Handles a change to the guard condition for managing initial Channel connect for the application. | Channel
|  | getMessageResponder(agent:MessageAgent, message:IMessage):MessageResponder Returns the appropriate MessageResponder for the Channel's send() method. | Channel
|  | internalConnect():void Connects the Channel to its endpoint. | Channel
|  | internalDisconnect(rejected:Boolean = false):void Disconnects the Channel from its endpoint. | Channel
|  | internalSend(messageResponder:MessageResponder):void Sends the Message out over the Channel and routes the response to the responder. | Channel

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | channelConnect | Dispatched after the channel has connected to its endpoint. | Channel
|  | channelDisconnect | Dispatched after the channel has disconnected from its endpoint. | Channel
|  | channelFault | Dispatched after the channel has faulted. | Channel
|  | message | Dispatched when a channel receives a message from its endpoint. | Channel
|  | propertyChange | Dispatched when a property of the channel changes. | Channel

Protected Constants
Hide Inherited Protected Constants
Show Inherited Protected Constants

| Constant | Defined By
--- | --- | ---
|  | CONNECT_TIMEOUT_SECONDS : String = connect-timeout-seconds [static] | Channel
|  | ENABLE_SMALL_MESSAGES : String = enable-small-messages [static] | Channel
|  | FALSE : String = false [static] | Channel
|  | LOGIN_AFTER_DISCONNECT : String = login-after-disconnect [static] | PollingChannel
|  | PIGGYBACKING_ENABLED : String = piggybacking-enabled [static] | PollingChannel
|  | POLLING_INTERVAL_LEGACY : String = polling-interval-seconds [static] | PollingChannel
|  | POLLING_INTERVAL_MILLIS : String = polling-interval-millis [static] | PollingChannel
|  | RECORD_MESSAGE_SIZES : String = record-message-sizes [static] | Channel
|  | RECORD_MESSAGE_TIMES : String = record-message-times [static] | Channel
|  | REQUEST_TIMEOUT_SECONDS : String = request-timeout-seconds [static] | Channel
|  | SERIALIZATION : String = serialization [static] | Channel
|  | TRUE : String = true [static] | Channel

Constructor Detail

PollingChannel | () | Constructor

`public function PollingChannel(id:String = null, uri:String = null)`

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

Creates a new PollingChannel instance with the specified id. Once a PollingChannel is connected and begins polling, it will issue a poll request once every three seconds by default.

Note: The PollingChannel type should not be constructed directly. Instead create instances of protocol specific subclasses such as HTTPChannel or AMFChannel that extend it.

Parameters

| `id:String` (default = `null`)`` — The id of this Channel.
| `uri:String` (default = `null`)`` — The uri for this Channel.

Method Detail

disablePolling | () | method

`public function disablePolling():void`

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

Disables polling based on the number of times `enablePolling()` and `disablePolling()` have been invoked. If the net result is to disable polling the channel stops polling.

Invoked automatically based upon subscribing or unsubscribing from a remote destination over a PollingChannel.

enablePolling | () | method |

`public function enablePolling():void`

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

Enables polling based on the number of times `enablePolling()` and `disablePolling()` have been invoked. If the net result is to enable polling the channel will poll the server on behalf of connected MessageAgents.

Invoked automatically based upon subscribing or unsubscribing from a remote destination over a PollingChannel.

poll | () | method |

`public function poll():void`

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

Initiates a poll operation if there are consumers subscribed to this channel, and polling is enabled for this channel. Note that this method will not start a new poll if one is currently in progress.

send | () | method |

`override public function send(agent:MessageAgent, message:IMessage):void`

Language Version : | ActionScript 3.0

Product Versions : | BlazeDS 4, LCDS 3

Runtime Versions : | Flash Player 9, AIR 1.1

Sends the specified message to its target destination. Subclasses must override the `internalSend()` method to perform the actual send. `PollingChannel` will wrap outbound messages in poll requests if a poll is not currently outstanding.

Parameters

| `agent:MessageAgent` — The MessageAgent that is sending the message.
| `message:IMessage` — The Message to send.

Throws

| `InvalidDestinationError` — If neither the MessageAgent nor the message specify a destination.

Constant Detail

LOGIN_AFTER_DISCONNECT | Constant

`protected static const LOGIN_AFTER_DISCONNECT:String = login-after-disconnect`

PIGGYBACKING_ENABLED | Constant |

`protected static const PIGGYBACKING_ENABLED:String = piggybacking-enabled`

POLLING_INTERVAL_LEGACY | Constant |

`protected static const POLLING_INTERVAL_LEGACY:String = polling-interval-seconds`

POLLING_INTERVAL_MILLIS | Constant |

`protected static const POLLING_INTERVAL_MILLIS:String = polling-interval-millis`

Sun Mar 5 2017, 03:42 PM +11:00