Packageorg.restfulx.controllers
Classpublic class ServicesController

Provides centralized access to currently available services.



Public Methods
 MethodDefined by
  
ServicesController(availableServices:Array, targetServiceId:int = -1)
ServicesController
  
addServiceProvider(serviceProvider:IServiceProvider):void
Adds a specific service provider instance to the array of available services
ServicesController
  
canLazyLoad(id:int):Boolean
A wrapper around IServiceProvider#canLazyLoad implementation of a specific service provider
ServicesController
  
generateId():int
[static] Creates a unique ID for the service.
ServicesController
  
Looks up a service provider instance by id
ServicesController
Constructor detail
ServicesController()constructor
public function ServicesController(availableServices:Array, targetServiceId:int = -1)

Parameters
availableServices:Array — the array of services to use (XMLHTTPServiceProvider is registered by default. All other providers (e.g. AIR) must be registered here)
 
targetServiceId:int (default = -1) — default service to use for operations (by default XMLHTTPServiceProvider.ID)
Method detail
addServiceProvider()method
public function addServiceProvider(serviceProvider:IServiceProvider):void

Adds a specific service provider instance to the array of available services

Parameters
serviceProvider:IServiceProvider — IServiceProvider instance to add
canLazyLoad()method 
public function canLazyLoad(id:int):Boolean

A wrapper around IServiceProvider#canLazyLoad implementation of a specific service provider

Parameters
id:int — service provider id

Returns
Boolean — true of the service provider can lazy load, false otherwise
generateId()method 
public static function generateId():int

Creates a unique ID for the service.

Returns
int — unique ID representing the service
getServiceProvider()method 
public function getServiceProvider(id:int):IServiceProvider

Looks up a service provider instance by id

Parameters
id:int — service provider id

Returns
IServiceProvider — IServiceProvider instance that corresponds to the ID provided