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

Package | mx.rpc.remoting
Class | public dynamic class RemoteObject
Inheritance | RemoteObject AbstractService flash.utils.Proxy
Subclasses | RemoteObject

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

The RemoteObject class gives you access to classes on a remote application server.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | channelSet : ChannelSet Provides access to the ChannelSet used by the service. | AbstractService
|  | concurrency : String Value that indicates how to handle multiple calls to the same service. | RemoteObject
|  | convertParametersHandler : Function An optional function, primarily intended for framework developers who need to install a function to get called with the parameters passed to each remote object invocation. | RemoteObject
|  | convertResultHandler : Function An optional function, primarily intended for framework developers who need to install a hook to process the results of an operation before notifying the result handlers. | RemoteObject
|  | destination : String The destination of the service. | AbstractService
|  | endpoint : String This property allows the developer to quickly specify an endpoint for a RemoteObject destination without referring to a services configuration file at compile time or programmatically creating a ChannelSet. | RemoteObject
|  | keepLastResult : Boolean Flag indicating whether the service's operations should keep their last call result for later access. | AbstractService
|  | makeObjectsBindable : Boolean When this value is true, anonymous objects returned are forced to bindable objects. | RemoteObject
|  | managers : Array The managers property stores a list of data managers which modify the behavior of this service. | AbstractService
|  | operations : Object The Operations array is usually only set by the MXML compiler if you create a service using an MXML tag. | AbstractService
|  | requestTimeout : int Provides access to the request timeout in seconds for sent messages. | AbstractService
|  | showBusyCursor : Boolean If true, a busy cursor is displayed while a service is executing. | RemoteObject
|  | source : String Lets you specify a source value on the client; not supported for destinations that use the JavaAdapter. | RemoteObject

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | _keepLastResult : Boolean = true | AbstractService

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | RemoteObject(destination:String = null) Creates a new RemoteObject. | RemoteObject
|  | disconnect():void Disconnects the service's network connection and removes any pending request responders. | AbstractService
|  | getOperation(name:String):AbstractOperation [override] Returns an Operation of the given name. | RemoteObject
|  | initialize():void Called to initialize the service. | AbstractService
|  | logout():void Logs the user out of the destination. | AbstractService
|  | setCredentials(username:String, password:String, charset:String = null):void Sets the credentials for the destination accessed by the service when using Data Services on the server side. | AbstractService
|  | setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String = null):void [override] If a remote object is managed by an external service, such a ColdFusion Component (CFC), a username and password can be set for the authentication mechanism of that remote service. | RemoteObject
|  | toString():String Represents an instance of RemoteObject as a String, describing important properties such as the destination id and the set of channels assigned. | RemoteObject

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | fault | The fault event is dispatched when a service call fails and isn't handled by the Operation itself. | AbstractService
|  | invoke | The invoke event is dispatched when a service Operation is invoked so long as an Error is not thrown before the Channel attempts to send the message. | AbstractService
|  | result | The result event is dispatched when a service call successfully returns and isn't handled by the Operation itself. | AbstractService

Property Detail

concurrency | property

`concurrency:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Value that indicates how to handle multiple calls to the same service. The default value is multiple. The following values are permitted:

- multiple - Existing requests are not cancelled, and the developer is responsible for ensuring the consistency of returned data by carefully managing the event stream. This is the default.
- single - Making only one request at a time is allowed on the method; additional requests made while a request is outstanding are immediately faulted on the client and are not sent to the server.
- last - Making a request causes the client to ignore a result or fault for any current outstanding request. Only the result or fault for the most recent request will be dispatched on the client. This may simplify event handling in the client application, but care should be taken to only use this mode when results or faults for requests may be safely ignored.

Implementation
`public function get concurrency():String`
`public function set concurrency(value:String):void`

convertParametersHandler | property |

`public var convertParametersHandler:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

An optional function, primarily intended for framework developers who need to install a function to get called with the parameters passed to each remote object invocation. The function takes an array of parameters and returns the potentially altered array. The function definition should look like: `function myParametersFunction(parameters:Array):Array`

convertResultHandler | property |

`public var convertResultHandler:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

An optional function, primarily intended for framework developers who need to install a hook to process the results of an operation before notifying the result handlers. The function definition should look like: `function myConvertResultsFunction(result: operation:AbstractOperation):` It is passed the result just after the makeObjectsBindable conversion has been done but before the result event is created.

endpoint | property |

`endpoint:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

This property allows the developer to quickly specify an endpoint for a RemoteObject destination without referring to a services configuration file at compile time or programmatically creating a ChannelSet. It also overrides an existing ChannelSet if one has been set for the RemoteObject service.

If the endpoint url starts with "https" a SecureAMFChannel will be used, otherwise an AMFChannel will be used. Two special tokens, {server.name} and {server.port}, can be used in the endpoint url to specify that the channel should use the server name and port that was used to load the SWF.

Note: This property is required when creating AIR applications.

Implementation
`public function get endpoint():String`
`public function set endpoint(value:String):void`

makeObjectsBindable | property |

`makeObjectsBindable:Boolean`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

When this value is true, anonymous objects returned are forced to bindable objects.

Implementation
`public function get makeObjectsBindable():Boolean`
`public function set makeObjectsBindable(value:Boolean):void`

showBusyCursor | property |

`showBusyCursor:Boolean`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

If `true`, a busy cursor is displayed while a service is executing. The default value is `false`.

Implementation
`public function get showBusyCursor():Boolean`
`public function set showBusyCursor(value:Boolean):void`

source | property |

`source:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Lets you specify a source value on the client; not supported for destinations that use the JavaAdapter. This allows you to provide more than one source that can be accessed from a single destination on the server.

Implementation
`public function get source():String`
`public function set source(value:String):void`
Constructor Detail

RemoteObject | () | Constructor

`public function RemoteObject(destination:String = null)`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Creates a new RemoteObject.

Parameters

| `destination:String` (default = `null`)`` — [optional] Destination of the RemoteObject; should match a destination name in the services-config.xml file.

Method Detail

getOperation | () | method

`override public function getOperation(name:String):AbstractOperation`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Returns an Operation of the given name. If the Operation wasn't created beforehand, a new `mx.rpc.remoting.Operation` is created during this call. Operations are usually accessible by simply naming them after the service variable (`myService.someOperation`), but if your Operation name happens to match a defined method on the service (like `setCredentials`), you can use this method to get the Operation instead.

Parameters

| `name:String` — Name of the Operation.

Returns

| `AbstractOperation` — Operation that executes for this name.

setRemoteCredentials | () | method |

`override public function setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String = null):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

If a remote object is managed by an external service, such a ColdFusion Component (CFC), a username and password can be set for the authentication mechanism of that remote service.

Parameters

| `remoteUsername:String` — the username to pass to the remote endpoint
| `remotePassword:String` — the password to pass to the remote endpoint
| `charset:String` (default = `null`)`` — The character set encoding to use while encoding the remote credentials. The default is null, which implies the legacy charset of ISO-Latin-1. The only other supported charset is "UTF-8".

toString | () | method |

`public function toString():String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Represents an instance of RemoteObject as a String, describing important properties such as the destination id and the set of channels assigned.

Returns

| `String` — Returns a String representing an instance of a RemoteObject.

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