Packagecom.vmware.flexutil.proxies
Classpublic class BaseProxy
InheritanceBaseProxy Inheritance Object

Base class for making remote java calls to services running on the vSphere Client app server.

Exposes a simple, easy-to-use api for making remote calls. The callService method can be used to make any remote service call.

Requires the callback function of the form function(ev:MethodReturnEvent).

View the examples



Public Methods
 MethodDefined By
  
BaseProxy(serviceName:String, channelUri:String)
BaseProxy
  
callService(methodName:String, arguments:Array, callback:Function = null, callContext:Object = null):void
Calls a remote service Java method.
BaseProxy
Constructor Detail
BaseProxy()Constructor
public function BaseProxy(serviceName:String, channelUri:String)

Parameters
serviceName:String — The service that this proxy talks to. This should match the flex:remoting-destination declared in the webapp/WEB-INF/spring/bundle-context.xml configuration file.
 
channelUri:String — The channel associated with the underlying service.
Method Detail
callService()method
public function callService(methodName:String, arguments:Array, callback:Function = null, callContext:Object = null):void

Calls a remote service Java method.

Parameters

methodName:String — Java method name to be invoked.
 
arguments:Array — method arguments.
 
callback:Function (default = null)function(ev:MethodReturnEvent)
 
callContext:Object (default = null) — object that needs to be passed back to caller via callback.

Examples
The following example shows a proxy that sub-classes BaseProxy:
    public class PluginServiceProxy extends BaseProxy {
       private static const SERVICE_NAME:String = "PluginService";
 
       public function PluginServiceProxy(
             channelUri:String=null) {
          super(SERVICE_NAME, channelUri);
       }
 
       public function someMethod(
             parameter:String,
             callback:Function = null,
             context:Object = null):void {
          callService("someMethod", [parameter], callback, context);
       }
    }