| Package | com.ericfeminella.rpc |
| Class | public class AMFPHPRemoteGateway |
| Inheritance | AMFPHPRemoteGateway flash.net.NetConnection |
| Implements | IIResponderProxy, IRemoteService |
Typically, you would sub-class AMFPHPRemoteGateway to provide a specific client side implementation of the remote services in which to invoke.
Sub classes of AMFPHPRemoteGateway should implement mx.rpc.IResponder and pass a reference to addResponder();
Below is a simple usage example:
package {
import com.ericfeminella.rpc.AMFPHPRemoteGateway;
import mx.rpc.IResponder;
public class AMFPHPRemoteGatewayExample extends AMFPHPRemoteGateway implements IResponder
{
public function AMFPHPRemoteGatewayExample(gatewayURI:String, classPath:String)
{
super(gatewayURI);
this.addResponder(this);
this.remoteServiceClass(classPath);
}
public function result(data:Object):void
{
trace(data as String);
}
public function fault(info:Object):void
{
trace(info as String);
}
}
}
| Property | Defined by | ||
|---|---|---|---|
| gatewayURI : String | AMFPHPRemoteGateway | ||
| remoteClass : String | AMFPHPRemoteGateway | ||
| responder : IResponder | AMFPHPRemoteGateway | ||
| Method | Defined by | ||
|---|---|---|---|
|
AMFPHPRemoteGateway(gatewayURI:String)
Constructor
Instantiates a new instance of AMFPHPRemoteGateway and sets
objectEncoding to ActionScript Message Format 3 (AMF3).
| AMFPHPRemoteGateway | ||
|
addResponder(responder:IResponder):void
Adds a responder which is invoked upon RPC result and fault
callbacks
| AMFPHPRemoteGateway | ||
|
disconnect():void
Disconnects Flash Player from the persisted RTMP connection
| AMFPHPRemoteGateway | ||
|
faultProxy(info:Object):void
Establishes the IResponder fault which will be used as a proxy
upon an Responder FaultEvent
| AMFPHPRemoteGateway | ||
|
getGatewayURI():String
returns the gateway URI for the instance of AMFPHPRemoteGateway
| AMFPHPRemoteGateway | ||
|
invoke(method:String, ... args):void
Performs rpc method invocation on a remote PHP object
| AMFPHPRemoteGateway | ||
|
remoteServiceClass(remoteClass:String):void
Sets the class in which remote method invocation is to be made
You must include the fully qualified classpath.
| AMFPHPRemoteGateway | ||
|
resultProxy(data:Object):void
Establishes the IResponder result which will be used as a proxy
upon an ResultEvent.
| AMFPHPRemoteGateway | ||
| gatewayURI | property |
protected var gatewayURI:String
| remoteClass | property |
protected var remoteClass:String
| responder | property |
protected var responder:IResponder
| AMFPHPRemoteGateway | () | constructor |
public function AMFPHPRemoteGateway(gatewayURI:String)Constructor Instantiates a new instance of AMFPHPRemoteGateway and sets objectEncoding to ActionScript Message Format 3 (AMF3).
ParametersgatewayURI:String — gateway.php URI; e.g: "http://localhost/amfphp/gateway.php"
|
| addResponder | () | method |
public function addResponder(responder:IResponder):voidAdds the responder which is invoked upon RPC result and fault callbacks
Parametersresponder:IResponder — object that implements IResponder
|
| disconnect | () | method |
public function disconnect():voidDisconnects the Flash Player from the persisted RTMP connection
| faultProxy | () | method |
public function faultProxy(info:Object):voidEstablishes the IResponder fault which will be used as a proxy upon an Responder FaultEvent
Parametersinfo:Object — IResponder fault method callback
|
| getGatewayURI | () | method |
public function getGatewayURI():Stringreturns the gateway URI for the instance of AMFPHPRemoteGateway
ReturnsString — the gateway URI
|
| invoke | () | method |
public function invoke(method:String, ... args):voidPerforms rpc method invocation on a remote PHP object
Parametersmethod:String — method to invoke on the remote object
|
|
... args — parameter of arbitrary lengt
|
| remoteServiceClass | () | method |
public function remoteServiceClass(remoteClass:String):voidSets the class in which remote method invocation is to be made You must include the fully qualified classpath.
For example, if a remote class EmailDelegate.php resides in a package data.business, you must set remoteServiceClass to the exact same path:
remoteServiceClass("data.business.EmailDelegate")
The remoteServiceClass can be set at runtime, therefore a single instance of AMFPHPRemoteGateway may call methods on various objects
ParametersremoteClass:String — remote class to invoke
|
| resultProxy | () | method |
public function resultProxy(data:Object):voidEstablishes the IResponder result which will be used as a proxy upon an ResultEvent.
Parametersdata:Object — IResponder result method callback
|