패키지 | mx.messaging |
클래스 | public class Channel |
상속 | Channel EventDispatcher Object |
구현 | IMXMLObject |
하위 클래스 | PollingChannel |
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Channels are specific protocol-based conduits for messages sent between
MessageAgents and remote destinations.
Preconfigured channels are obtained within the framework using the
ServerConfig.getChannel()
method.
You can create a Channel directly using the new
operator and
add it to a ChannelSet directly.
Channels represent a physical connection to a remote endpoint. Channels are shared across destinations by default. This means that a client targetting different destinations may use the same Channel to communicate with these destinations.
Note: This class is for advanced use only. Use this class for creating custom channels like the existing RTMPChannel, AMFChannel, and HTTPChannel.
속성 | 정의 주체 | ||
---|---|---|---|
authenticated : Boolean [읽기 전용]
Indicates if this channel is authenticated. | Channel | ||
channelSets : Array [읽기 전용]
Provides access to the ChannelSets connected to the Channel. | Channel | ||
connected : Boolean [읽기 전용]
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 | ||
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
endpoint : String [읽기 전용]
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 [읽기 전용]
Provides access to the protocol that the channel uses. | Channel | ||
reconnecting : Boolean [읽기 전용]
Indicates whether this channel is in the process of reconnecting to an
alternate endpoint. | Channel | ||
recordMessageSizes : Boolean [읽기 전용]
Channel property determines the level of performance information injection - whether
we inject message sizes or not. | Channel | ||
recordMessageTimes : Boolean [읽기 전용]
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 |
속성 | 정의 주체 | ||
---|---|---|---|
shouldBeConnected : Boolean [읽기 전용]
Indicates whether this channel should be connected to its endpoint. | Channel |
메서드 | 정의 주체 | ||
---|---|---|---|
Constructs an instance of a generic Channel that connects to the
specified endpoint URI. | Channel | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Subclasses should override this method to apply any settings that may be
necessary for an individual channel. | Channel | ||
Connects the ChannelSet to the Channel. | Channel | ||
Disconnects the ChannelSet from the Channel. | Channel | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
Sends a CommandMessage to the server to logout if the Channel is connected. | Channel | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
Sends the specified message to its target destination. | Channel | ||
Sets the credentials to the specified value. | Channel | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
메서드 | 정의 주체 | ||
---|---|---|---|
Applies the client load balancing urls if they exists. | Channel | ||
Processes a failed internal connect and dispatches the
FAULT event for the channel. | Channel | ||
Processes a successful internal connect and dispatches the
CONNECT event for the Channel. | Channel | ||
Handles a connect timeout by dispatching a ChannelFaultEvent. | Channel | ||
Processes a failed internal disconnect and dispatches the
FAULT event for the channel. | Channel | ||
Processes a successful internal disconnect and dispatches the
DISCONNECT event for the Channel. | Channel | ||
Handles a change to the guard condition for managing initial Channel connect for the application. | Channel | ||
Returns the appropriate MessageResponder for the Channel's
send() method. | Channel | ||
Connects the Channel to its endpoint. | Channel | ||
Disconnects the Channel from its endpoint. | Channel | ||
Sends the Message out over the Channel and routes the response to the
responder. | Channel |
이벤트 | 요약 | 정의 주체 | ||
---|---|---|---|---|
[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 얻어 활성화될 때 전달됩니다. | EventDispatcher | |||
Dispatched after the channel has connected to its endpoint. | Channel | |||
Dispatched after the channel has disconnected from its endpoint. | Channel | |||
Dispatched after the channel has faulted. | Channel | |||
[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 잃고 비활성화될 때 전달됩니다. | EventDispatcher | |||
Dispatched when a channel receives a message from its endpoint. | Channel | |||
Dispatched when a property of the channel changes. | Channel |
상수 | 정의 주체 | ||
---|---|---|---|
CONNECT_TIMEOUT_SECONDS : String = "connect-timeout-seconds" [정적] | Channel | ||
ENABLE_SMALL_MESSAGES : String = "enable-small-messages" [정적] | Channel | ||
FALSE : String = "false" [정적] | Channel | ||
RECORD_MESSAGE_SIZES : String = "record-message-sizes" [정적] | Channel | ||
RECORD_MESSAGE_TIMES : String = "record-message-times" [정적] | Channel | ||
REQUEST_TIMEOUT_SECONDS : String = "request-timeout-seconds" [정적] | Channel | ||
SERIALIZATION : String = "serialization" [정적] | Channel | ||
TRUE : String = "true" [정적] | Channel |
authenticated | 속성 |
channelSets | 속성 |
connected | 속성 |
connected:Boolean
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Indicates whether this channel has established a connection to the remote destination.
이 속성은 데이터 바인딩에 대한 소스로 사용할 수 있습니다. 이 속성을 수정하면 propertyChange
이벤트를 전달합니다.
구현
public function get connected():Boolean
connectTimeout | 속성 |
connectTimeout:int
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Provides access to the connect timeout in seconds for the channel. A value of 0 or below indicates that a connect attempt will never be timed out on the client. For channels that are configured to failover, this value is the total time to wait for a connection to be established. It is not reset for each failover URI that the channel may attempt to connect to.
구현
public function get connectTimeout():int
public function set connectTimeout(value:int):void
endpoint | 속성 |
failoverURIs | 속성 |
failoverURIs:Array
Provides access to the set of endpoint URIs that this channel can attempt to failover to if the endpoint is clustered.
This property is automatically populated when clustering is enabled. If you don't use clustering, you can set your own values.
구현
public function get failoverURIs():Array
public function set failoverURIs(value:Array):void
id | 속성 |
protocol | 속성 |
protocol:String
[읽기 전용] Provides access to the protocol that the channel uses.
Note: Subclasses of Channel must override this method and return a string that represents their supported protocol. Examples of supported protocol strings are "rtmp", "http" or "https".
구현
public function get protocol():String
reconnecting | 속성 |
recordMessageSizes | 속성 |
recordMessageSizes:Boolean
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Channel property determines the level of performance information injection - whether we inject message sizes or not.
구현
public function get recordMessageSizes():Boolean
recordMessageTimes | 속성 |
recordMessageTimes:Boolean
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Channel property determines the level of performance information injection - whether we inject timestamps or not.
구현
public function get recordMessageTimes():Boolean
requestTimeout | 속성 |
requestTimeout:int
Provides access to the default request timeout in seconds for the channel. A value of 0 or below indicates that outbound requests will never be timed out on the client.
Request timeouts are most useful for RPC style messaging that requires a response from the remote destination.
구현
public function get requestTimeout():int
public function set requestTimeout(value:int):void
shouldBeConnected | 속성 |
shouldBeConnected:Boolean
[읽기 전용] Indicates whether this channel should be connected to its endpoint. This flag is used to control when fail over should be attempted and when disconnect notification is sent to the remote endpoint upon disconnect or fault.
구현
protected function get shouldBeConnected():Boolean
uri | 속성 |
Channel | () | 생성자 |
public function Channel(id:String = null, uri:String = null)
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Constructs an instance of a generic Channel that connects to the specified endpoint URI. Note: The Channel type should not be constructed directly. Instead create instances of protocol specific subclasses such as RTMPChannel or AMFChannel.
매개 변수id:String (default = null ) — The id of this channel.
| |
uri:String (default = null ) — The endpoint URI for this channel.
|
applyClientLoadBalancingSettings | () | 메서드 |
protected function applyClientLoadBalancingSettings(props:XML):void
Applies the client load balancing urls if they exists. It randomly picks
a url from the set of client load balancing urls and sets it as the channel's
main url; then it assigns the rest of the urls as the failoverURIs
of the channel.
매개 변수
props:XML — The properties section of the XML fragment of the services-config.xml
file for this channel.
|
applySettings | () | 메서드 |
public function applySettings(settings:XML):void
Subclasses should override this method to apply any settings that may be
necessary for an individual channel.
Make sure to call super.applySettings()
to apply common settings for the channel. This method is used primarily in Channel subclasses.
매개 변수
settings:XML — XML fragment of the services-config.xml file for this channel.
|
connect | () | 메서드 |
public final function connect(channelSet:ChannelSet):void
Connects the ChannelSet to the Channel. If the Channel has not yet
connected to its endpoint, it attempts to do so.
Channel subclasses must override the internalConnect()
method, and call the connectSuccess()
method once the
underlying connection is established.
매개 변수
channelSet:ChannelSet — The ChannelSet to connect to the Channel.
|
connectFailed | () | 메서드 |
protected function connectFailed(event:ChannelFaultEvent):void
Processes a failed internal connect and dispatches the
FAULT
event for the channel.
If the Channel has failoverURI
values, it will
attempt to reconnect automatically by trying these URI values in order until
a connection is established or the available values are exhausted.
매개 변수
event:ChannelFaultEvent — The ChannelFaultEvent for the failed connect.
|
connectSuccess | () | 메서드 |
protected function connectSuccess():void
Processes a successful internal connect and dispatches the
CONNECT
event for the Channel.
connectTimeoutHandler | () | 메서드 |
protected function connectTimeoutHandler(event:flash.events:TimerEvent):void
Handles a connect timeout by dispatching a ChannelFaultEvent.
Subtypes may overide this to shutdown the current connect attempt but must
call super.connectTimeoutHandler(event)
.
매개 변수
event:flash.events:TimerEvent — The timer event indicating that the connect timeout has been reached.
|
disconnect | () | 메서드 |
public final function disconnect(channelSet:ChannelSet):void
Disconnects the ChannelSet from the Channel. If the Channel is connected to its endpoint and it has no more connected ChannelSets it will internally disconnect.
Channel subclasses need to override the
internalDisconnect()
method, and call the
disconnectSuccess()
method when the underlying connection
has been terminated.
매개 변수
channelSet:ChannelSet — The ChannelSet to disconnect from the Channel.
|
disconnectFailed | () | 메서드 |
protected function disconnectFailed(event:ChannelFaultEvent):void
Processes a failed internal disconnect and dispatches the
FAULT
event for the channel.
매개 변수
event:ChannelFaultEvent — The ChannelFaultEvent for the failed disconnect.
|
disconnectSuccess | () | 메서드 |
protected function disconnectSuccess(rejected:Boolean = false):void
Processes a successful internal disconnect and dispatches the
DISCONNECT
event for the Channel.
If the disconnect is due to a network failure and the Channel has
failoverURI
values, it will attempt to reconnect automatically
by trying these URI values in order until a connection is established or the
available values are exhausted.
매개 변수
rejected:Boolean (default = false ) — True if the disconnect should skip any
failover processing that would otherwise be attempted; false
if failover processing should be allowed to run.
|
flexClientWaitHandler | () | 메서드 |
protected function flexClientWaitHandler(event:PropertyChangeEvent):void
Handles a change to the guard condition for managing initial Channel connect for the application. When this is invoked it means that this Channel is waiting to attempt to connect.
매개 변수
event:PropertyChangeEvent — The PropertyChangeEvent dispatched by the FlexClient singleton.
|
getMessageResponder | () | 메서드 |
protected function getMessageResponder(agent:MessageAgent, message:IMessage):MessageResponder
Returns the appropriate MessageResponder for the Channel's
send()
method.
Must be overridden.
매개 변수
agent:MessageAgent — The MessageAgent sending the message.
| |
message:IMessage — The Message to send.
|
MessageResponder — The MessageResponder to handle the result or fault.
|
오류
IllegalOperationError — If the Channel subclass does not override
this method.
|
internalConnect | () | 메서드 |
protected function internalConnect():void
Connects the Channel to its endpoint. Must be overridden.
internalDisconnect | () | 메서드 |
protected function internalDisconnect(rejected:Boolean = false):void
Disconnects the Channel from its endpoint. Must be overridden.
매개 변수
rejected:Boolean (default = false ) — True if the disconnect was due to a connection rejection or timeout
and reconnection should not be attempted automatically; otherwise false.
|
internalSend | () | 메서드 |
protected function internalSend(messageResponder:MessageResponder):void
Sends the Message out over the Channel and routes the response to the responder. Must be overridden.
매개 변수
messageResponder:MessageResponder — The MessageResponder to handle the response.
|
logout | () | 메서드 |
public function logout(agent:MessageAgent):void
Sends a CommandMessage to the server to logout if the Channel is connected. Current credentials are cleared.
매개 변수
agent:MessageAgent — The MessageAgent to logout.
|
send | () | 메서드 |
public function send(agent:MessageAgent, message:IMessage):void
Sends the specified message to its target destination.
Subclasses must override the internalSend()
method to
perform the actual send.
매개 변수
agent:MessageAgent — The MessageAgent that is sending the message.
| |
message:IMessage — The Message to send.
|
오류
InvalidDestinationError — If neither the MessageAgent nor the
message specify a destination.
|
setCredentials | () | 메서드 |
public function setCredentials(credentials:String, agent:MessageAgent = null, charset:String = null):void
Sets the credentials to the specified value. If the credentials are non-null and the Channel is connected, this method also sends a CommandMessage to the server to login using the credentials.
매개 변수
credentials:String — The credentials string.
| |
agent:MessageAgent (default = null ) — The MessageAgent to login, that will handle the login result.
| |
charset:String (default = null ) — The character set encoding used while encoding the
credentials. The default is null, which implies the legacy charset of
ISO-Latin-1.
|
오류
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.
|
channelConnect | 이벤트 |
mx.messaging.events.ChannelEvent
속성 ChannelEvent.type =
mx.messaging.events.ChannelEvent.CONNECT
Dispatched after the channel has connected to its endpoint.
Channel and its subclasses issue a Channel.Connect.Failed code whenever there is an issue in a channel's connect attempts to a remote destination. An AMFChannel object issues Channel.Call.Failed code when the channel is already connected but it gets a Call.Failed code from its underlying NetConnection.
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 | 이벤트 |
mx.messaging.events.ChannelEvent
속성 ChannelEvent.type =
mx.messaging.events.ChannelEvent.DISCONNECT
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Dispatched after the channel 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 | 이벤트 |
mx.messaging.events.ChannelFaultEvent
속성 ChannelFaultEvent.type =
mx.messaging.events.ChannelFaultEvent.FAULT
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Dispatched after the channel 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. |
message | 이벤트 |
mx.messaging.events.MessageEvent
속성 MessageEvent.type =
mx.messaging.events.MessageEvent.MESSAGE
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Dispatched when a channel receives a message from its endpoint.
The MESSAGE event type; dispatched upon receipt of a message.The value of this constant is "message"
.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
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 . |
message | The message associated with this event. |
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 | 이벤트 |
mx.events.PropertyChangeEvent
속성 PropertyChangeEvent.type =
mx.events.PropertyChangeEvent.PROPERTY_CHANGE
언어 버전: | ActionScript 3.0 |
제품 버전: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Dispatched when a property of the channel changes.
ThePropertyChangeEvent.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. |
CONNECT_TIMEOUT_SECONDS | 상수 |
protected static const CONNECT_TIMEOUT_SECONDS:String = "connect-timeout-seconds"
ENABLE_SMALL_MESSAGES | 상수 |
protected static const ENABLE_SMALL_MESSAGES:String = "enable-small-messages"
FALSE | 상수 |
protected static const FALSE:String = "false"
RECORD_MESSAGE_SIZES | 상수 |
protected static const RECORD_MESSAGE_SIZES:String = "record-message-sizes"
RECORD_MESSAGE_TIMES | 상수 |
protected static const RECORD_MESSAGE_TIMES:String = "record-message-times"
REQUEST_TIMEOUT_SECONDS | 상수 |
protected static const REQUEST_TIMEOUT_SECONDS:String = "request-timeout-seconds"
SERIALIZATION | 상수 |
protected static const SERIALIZATION:String = "serialization"
TRUE | 상수 |
protected static const TRUE:String = "true"
Tue Jun 12 2018, 03:17 PM Z