ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
 

Package com.adobe.gravity.utility 


Public Methods
 FunctionDefined By
  
Retrieve a set of services at once.
com.adobe.gravity.utility
  
ungetServices(context:IBundleContext, serviceReferences:Array):void
Release a set of services.
com.adobe.gravity.utility
Function detail

getServices

()function
public function getServices(context:IBundleContext, ... serviceClasses):com.adobe.gravity.utility.async:IToken

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Client Component Framework 10
Runtime Versions: AIR 1.1, Flash Player 9

Retrieve a set of services at once. The caller is responsible for releasing all the services thus obtained. If you will be using the services over an extended period of time rather than just over the course of an asynchronous function call, it would generally be more efficient and less error-prone to use ServiceTracker objects. The getServices helper function is intended for use with infrequently called asynchronous APIs.

For example, to retrieve both the IProgressService and the ILocalizedMessageService:

     var token:IToken = getServices(BundleContext.currentContext, IProgressService, ILocalizedMessageService);
     token.addSuccessHandler(doWork);
     token.addFaultHandler(errorHandler);
     

The doWork function must take an array as the first parameter and for each service class specified in the getServices call, an object of the corresponding type. For the above example this would mean

     private function doWork(serviceReferences:Array, progressService:IProgressService, localizedMessageService:ILocalizedMessageService):void
     {
         // do work using progressService and localizedMessageService
     
         // release the references acquired with getServices
         unget(BundleContext.currentContext, serviceReferences);
     }
     

Parameters

context:IBundleContext — The bundle context with which to acquire the services.
 
... serviceClasses — The service classes to be acquired.

Returns
com.adobe.gravity.utility.async:IToken — A token to add success and fault handlers to.

ungetServices

()function 
public function ungetServices(context:IBundleContext, serviceReferences:Array):void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Client Component Framework 10
Runtime Versions: AIR 1.1, Flash Player 9

Release a set of services.

Parameters

context:IBundleContext — The bundle context for the bundle releasing the services.
 
serviceReferences:Array — An Array containing IServiceReference objects to be released.