| Package | system.remoting |
| Class | public class RemotingService |
| Inheritance | RemotingService CoreAction Task Object |
Example :
package examples
{
import core.dump;
import system.remoting.RemotingService;
import flash.display.Sprite;
public class RemotingExample extends Sprite
{
public function RemotingExample()
{
var service:RemotingService = new RemotingService() ;
service.finishIt.connect( finish ) ;
service.progressIt.connect( progress ) ;
service.startIt.connect( start ) ;
service.timeoutIt.connect( timeout ) ;
service.error.connect( error ) ;
service.fault.connect( fault ) ;
service.result.connect( result ) ;
service.gatewayUrl = gatewayUrl ;
service.serviceName = "Test" ;
service.methodName = "hello" ;
service.run( "world" ) ;
}
public var gatewayUrl:String =
"http://localhost:8888/maashaack/amfphp/gateway.php" ;
//////////////// slots
protected function error( error:, service:RemotingService ):void
{
trace("error:" + dump(error) ) ;
}
protected function fault( fault:, service:RemotingService ):void
{
trace("fault:" + dump(fault) ) ;
}
protected function finish( service:RemotingService ):void
{
trace( "#finish" ) ;
}
protected function result( result:, service:RemotingService ):void
{
trace("result : " + result ) ;
}
protected function start( service:RemotingService ):void
{
trace( "#start : " + service ) ;
}
protected function timeout( service:RemotingService ):void
{
trace( "#timeout" ) ;
}
////////////////
}
}
| Property | Defined By | ||
|---|---|---|---|
![]() | changeIt : Signaler
This signal emit when the notifyChanged method is invoked. | CoreAction | |
![]() | clearIt : Signaler
This signal emit when the notifyCleared method is invoked. | CoreAction | |
| connection : RemotingConnection [read-only]
The internal RemotingConnection reference. | RemotingService | ||
| delay : uint [read-only]
Indicates the timeout interval duration (default 12000 ms). | RemotingService | ||
| error : Signal [read-only]
This signal emit when the service receive a error message from the server
| RemotingService | ||
| fault : Signal [read-only]
This signal emit when the service receive a fault message from the server
| RemotingService | ||
![]() | finishIt : Signaler
This signal emit when the notifyFinished method is invoked. | Task | |
| gatewayUrl : String
Indicates a string containing a dot delimited path from the root of the Flash Remoting Server to the service name. | RemotingService | ||
![]() | infoIt : Signaler
This signal emit when the notifyInfo method is invoked. | CoreAction | |
| listener : IRemotingServiceListener
Defines the IRemotingService reference of this remoting service. | RemotingService | ||
![]() | logger : Logger
Determinates the internal Logger reference of this Loggable object. | Task | |
![]() | looping : Boolean
The flag to determinate if the Action object is looped. | CoreAction | |
![]() | loopIt : Signaler
This signal emit when the notifyLooped method is invoked. | CoreAction | |
| methodName : String
Indicates the name of the server-side service's method. | RemotingService | ||
| multipleSimultaneousAllowed : Boolean
Defines if the service can lauch multiple simultaneous connections. | RemotingService | ||
| objectEncoding : uint = 3.0
The object encoding (AMF version) for the internal NetConnection instance. | RemotingService | ||
| params : Array
Determinates the Array representation of all arguments to pass in the service method. | RemotingService | ||
![]() | pauseIt : Signaler
This signal emit when the notifyPause method is invoked. | CoreAction | |
![]() | phase : String [read-only]
The current phase of the action. | Task | |
![]() | progressIt : Signaler
This signal emit when the notifyProgress method is invoked. | CoreAction | |
| proxy : RemotingServiceProxy [read-only]
Determinates a RemotingServiceProxy of the current service to use simple methods to run remoting queries. | RemotingService | ||
| result : Signal [read-only]
This signal emit when the service receive a result with success. | RemotingService | ||
![]() | resumeIt : Signaler
This signal emit when the notifyResumed method is invoked. | CoreAction | |
![]() | running : Boolean [read-only]
Indicates true if the process is in progress. | Task | |
| scope : String
The scope of this object ("prototype" or "singleton")
| RemotingService | ||
| serviceName : String
Indicates the name of the server-side service. | RemotingService | ||
![]() | startIt : Signaler
This signal emit when the notifyStarted method is invoked. | Task | |
![]() | stopIt : Signaler
This signal emit when the notifyStopped method is invoked. | CoreAction | |
![]() | timeoutIt : Signaler
This signal emit when the notifyTimeOut method is invoked. | CoreAction | |
| timeoutPolicy : TimeoutPolicy
Indicates the timeout policy value of this service. | RemotingService | ||
| Method | Defined By | ||
|---|---|---|---|
RemotingService(gatewayUrl:String = null, serviceName:String = null, methodName:String = null, params:Array = null)
Creates a new RemotingService instance. | RemotingService | ||
clone():* [override]
Returns a shallow copy of this object. | RemotingService | ||
![]() | isLocked():Boolean
Returns true if the object is locked. | Task | |
![]() | lock():void
Locks the object. | Task | |
![]() | notifyChanged():void
Notify when the process is changed. | CoreAction | |
![]() | notifyCleared():void
Notify when the process is cleared. | CoreAction | |
![]() | notifyFinished():void
Notify an ActionEvent when the process is finished. | Task | |
![]() | notifyInfo(info:*):void
Notify a specific information when the process is changed. | CoreAction | |
![]() | notifyLooped():void
Notify when the process is looped. | CoreAction | |
![]() | notifyPaused():void
Notify when the process is paused. | CoreAction | |
![]() | notifyProgress():void
Notify when the process is in progress. | CoreAction | |
![]() | notifyResumed():void
Notify when the process is resumed. | CoreAction | |
![]() | notifyStarted():void
Notify an ActionEvent when the process is started. | Task | |
![]() | notifyStopped():void
Notify when the process is stopped. | CoreAction | |
![]() | notifyTimeOut():void
Notify when the process is out of time. | CoreAction | |
registerClassAlias(aliasName:String, classObject:Class):void [static]
Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF). | RemotingService | ||
run(... arguments):void [override]
Run the process of the remoting service. | RemotingService | ||
setCredentials(authentification:RemotingAuthentification = null):void
Defines a set of credentials to be presented to the server on all subsequent requests. | RemotingService | ||
setDelay(time:uint, useSeconds:Boolean = false):void
Set timeout interval duration. | RemotingService | ||
toString():String
Returns the String representation of this object. | RemotingService | ||
![]() | unlock():void
Unlocks the display. | Task | |
| Constant | Defined By | ||
|---|---|---|---|
| DEFAULT_DELAY : uint = 25000 [static]
The default delay value before notify the timeout event (25 seconds)
| RemotingService | ||
| LEVEL_ERROR : String = error [static]
The string representation value of the level error of the service. | RemotingService | ||
| connection | property |
connection:RemotingConnection [read-only] The internal RemotingConnection reference.
public function get connection():RemotingConnection| delay | property |
delay:uint [read-only] Indicates the timeout interval duration (default 12000 ms).
Uses the setDelay() method to change this value.
public function get delay():uint| error | property |
error:Signal [read-only] This signal emit when the service receive a error message from the server
public function get error():Signal| fault | property |
fault:Signal [read-only] This signal emit when the service receive a fault message from the server
public function get fault():Signal| gatewayUrl | property |
gatewayUrl:StringIndicates a string containing a dot delimited path from the root of the Flash Remoting Server to the service name.
public function get gatewayUrl():String public function set gatewayUrl(value:String):void| listener | property |
listener:IRemotingServiceListener
Defines the IRemotingService reference of this remoting service.
public function get listener():IRemotingServiceListener public function set listener(value:IRemotingServiceListener):void| methodName | property |
public var methodName:StringIndicates the name of the server-side service's method.
| multipleSimultaneousAllowed | property |
public var multipleSimultaneousAllowed:BooleanDefines if the service can lauch multiple simultaneous connections.
| objectEncoding | property |
public var objectEncoding:uint = 3.0The object encoding (AMF version) for the internal NetConnection instance.
| params | property |
params:ArrayDeterminates the Array representation of all arguments to pass in the service method.
public function get params():Array public function set params(value:Array):void| proxy | property |
proxy:RemotingServiceProxy [read-only] Determinates a RemotingServiceProxy of the current service to use simple methods to run remoting queries.
public function get proxy():RemotingServiceProxy| result | property |
result:Signal [read-only] This signal emit when the service receive a result with success.
public function get result():Signal| scope | property |
scope:StringThe scope of this object ("prototype" or "singleton")
public function get scope():String public function set scope(value:String):voidSee also
| serviceName | property |
public var serviceName:StringIndicates the name of the server-side service.
| timeoutPolicy | property |
timeoutPolicy:TimeoutPolicyIndicates the timeout policy value of this service. Use limit timeout interval.
public function get timeoutPolicy():TimeoutPolicy public function set timeoutPolicy(value:TimeoutPolicy):voidSee also
| RemotingService | () | Constructor |
public function RemotingService(gatewayUrl:String = null, serviceName:String = null, methodName:String = null, params:Array = null)Creates a new RemotingService instance.
ParametersgatewayUrl:String (default = null) — The url of the gateway of the remoting service.
| |
serviceName:String (default = null) — (optional) The name of the service in the server.
| |
methodName:String (default = null) — (optional) The method name to invoke in the specific remoting service.
| |
params:Array (default = null) |
| clone | () | method |
override public function clone():*Returns a shallow copy of this object.
Returns* — a shallow copy of this object.
|
| registerClassAlias | () | method |
public static function registerClassAlias(aliasName:String, classObject:Class):voidPreserves the class (type) of an object when the object is encoded in Action Message Format (AMF). When you encode an object into AMF, this function saves the alias for its class, so that you can recover the class when decoding the object. If the encoding context did not register an alias for an object's class, the object is encoded as an anonymous object. Similarly, if the decoding context does not have the same alias registered, an anonymous object is created for the decoded data. This static method is the same like the flash.net.registerClassAlias singleton method.
Parameters
aliasName:String | |
classObject:Class |
| run | () | method |
override public function run(... arguments):voidRun the process of the remoting service.
Parameters
... arguments |
| setCredentials | () | method |
public function setCredentials(authentification:RemotingAuthentification = null):voidDefines a set of credentials to be presented to the server on all subsequent requests.
Parameters
authentification:RemotingAuthentification (default = null) — The RemotingAuthentification instance to presented to the server.
|
See also
| setDelay | () | method |
public function setDelay(time:uint, useSeconds:Boolean = false):voidSet timeout interval duration.
Parameters
time:uint — the delay value of the timeout event notification.
| |
useSeconds:Boolean (default = false) — Indicates if the time value is in seconds true or milliseconds false.
|
| toString | () | method |
public function toString():String
Returns the String representation of this object.
String — the String representation of this object.
|
| DEFAULT_DELAY | Constant |
public static const DEFAULT_DELAY:uint = 25000The default delay value before notify the timeout event (25 seconds)
| LEVEL_ERROR | Constant |
public static const LEVEL_ERROR:String = errorThe string representation value of the level error of the service.