An Operation used specifically by RemoteObjects. An Operation is an individual method on a service. An Operation can be called either by invoking the function of the same name on the service or by accessing the Operation as a property on the service and calling the send() method.

Constructor

@:value({ name : null, remoteObject : null })new(?remoteObject:AbstractService, ?name:String)

Creates a new Operation. This is usually done directly automatically by the RemoteObject when an unknown operation has been accessed. It is not recommended that a developer use this constructor directly.

Parameters:

service

The RemoteObject object defining the service.

name

The name of the service.

Variables

argumentNames:Array<String>

An ordered list of the names of the arguments to pass to a method invocation. Since the arguments object is a hashmap with no guaranteed ordering, this array helps put everything together correctly. It will be set automatically by the MXML compiler, if necessary, when the Operation is used in tag form.

@:flash.propertyconcurrency:String

The concurrency for this Operation. If it has not been explicitly set the setting from the RemoteObject will be used.

@:flash.propertyshowBusyCursor:Bool

Whether this operation should show the busy cursor while it is executing. If it has not been explicitly set the setting from the RemoteObject will be used.

Methods

Inherited Variables

Defined by AbstractOperation

arguments:Dynamic

The arguments to pass to the Operation when it is invoked. If you call the send() method with no parameters, an array based on this object is sent. If you call the send() method with parameters (or call the function directly on the service) those parameters are used instead of whatever is stored in this property. For RemoteObject Operations the associated argumentNames array determines the order of the arguments passed.

@:flash.propertyname:String

The name of this Operation. This is how the Operation is accessed off the service. It can only be set once.

properties:Dynamic

This is a hook primarily for framework developers to register additional user specified properties for your operation.

@:flash.propertyread onlyservice:AbstractService

Provides convenient access to the service on which the Operation is being invoked. Note that the service cannot be changed after the Operation is constructed.

Defined by AbstractInvoker

@:flash.propertyread onlykeepLastResult:Bool

Flag indicating whether the operation should keep its last call result for later access.

If set to true, the last call result will be accessible through lastResult bindable property.

If set to false, the last call result will be cleared after the call, and must be processed in the operation's result handler. This will allow the result object to be garbage collected, which is especially useful if the operation is only called a few times and returns a large result.

If not set, will use the keepLastResult value of its owning Service, if any, or the default value.

See also:

  • lastResult

  • mx.rpc.AbstractService#keepLastResult

@:flash.propertyread onlylastResult:Dynamic

The result of the last invocation.

@:flash.propertymakeObjectsBindable:Bool

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

operationManager:Function

This property is set usually by framework code which wants to modify the behavior of a service invocation without modifying the way in which the service is called externally. This allows you to add a "filter" step on the method call to ensure for example that you do not return duplicate instances for the same id or to insert parameters for performing on-demand paging.

When this is set to a non-null value on the send call, the operationManager function is called instead. It returns the token that the caller uses to be notified of the result. Typically the called function will at some point clear this property temporarily, then invoke the operation again actually sending it to the server this time.

resultElementType:Class<Dynamic>

Like resultType, used to define the ActionScript class used by a given operation though this property only applies to operations which return a multi-valued result (e.g. an Array or ArrayCollection (IList)). This property specifies an ActionScript class for the members of the array or array collection. When you set resultElementType, you do not have to set resultType. In that case, the operation returns an Array if makeObjectsbindable is false and an ArrayCollection otherwise.

resultType:Class<Dynamic>

Specifies an optional return type for the operation. Used in situations where you want to coerce the over-the-wire information into a specific ActionScript class or to provide metadata for other services as to the return type of this operation.

Inherited Methods

Defined by AbstractInvoker

@:value({ fireBindingEvent : true })clearResult(fireBindingEvent:Bool = true):Void

Sets the result property of the invoker to null. This is useful when the result is a large object that is no longer being used.

Parameters:

fireBindingEvent

Set to true if you want anything bound to the result to update. Otherwise, set to false. The default value is true

setResult(result:Any):Void

This hook is exposed to update the lastResult property. Since lastResult is ordinarily updated automatically by the service, you do not typically call this. It is used by managed services that want to ensure lastResult always points to "the" managed instance for a given identity even if the the service returns a new copy of the same object.

Parameters:

result

The new value for the lastResult property.