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

ServiceTracker  - AS3 ADEP Client Component

Packagecom.adobe.gravity.tracker
Classpublic class ServiceTracker
InheritanceServiceTracker Inheritance EventDispatcher Inheritance Object
Implements IServiceTrackerCustomizer

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

ServiceTracker objects dynamically track the set of services matching specified criteria, updating appropriately as services are registered and unregistered.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  service : Object
[read-only] The highest-ranked service that matches the tracking criteria.
ServiceTracker
  services : Array
[read-only] The set of services that are being tracked, in ranking order.
ServiceTracker
  size : uint
[read-only] The number of services that currently match the tracking criteria.
ServiceTracker
  trackingCount : uint
[read-only] A number that increments every time the set of tracked services changes.
ServiceTracker
Protected Properties
 PropertyDefined By
  context : IBundleContext
[read-only] The bundle context for this tracker.
ServiceTracker
  filter : IFilter
[read-only] The service filter that this tracker is using, if any.
ServiceTracker
Public Methods
 MethodDefined By
  
ServiceTracker(context:IBundleContext, serviceInterface:Class, filter:IFilter = null, customizer:com.adobe.gravity.tracker:IServiceTrackerCustomizer = null)
Constructor.
ServiceTracker
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
Called when a new service appears that is to be tracked.
ServiceTracker
  
Stop tracking services.
ServiceTracker
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Called when service properties are modified.
ServiceTracker
  
Start tracking services.
ServiceTracker
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Called when a service is no longer to be tracked.
ServiceTracker
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Property Detail

context

property
context:IBundleContext  [read-only]

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

The bundle context for this tracker.



Implementation
    protected function get context():IBundleContext

filter

property 
filter:IFilter  [read-only]

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

The service filter that this tracker is using, if any.



Implementation
    protected function get filter():IFilter

service

property 
service:Object  [read-only]

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

The highest-ranked service that matches the tracking criteria.

This property can be used as the source for data binding. When this property is modified, it dispatches the serviceChanged event.



Implementation
    public function get service():Object

services

property 
services:Array  [read-only]

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

The set of services that are being tracked, in ranking order.

This property can be used as the source for data binding. When this property is modified, it dispatches the servicesChanged event.



Implementation
    public function get services():Array

size

property 
size:uint  [read-only]

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

The number of services that currently match the tracking criteria.

This property can be used as the source for data binding. When this property is modified, it dispatches the sizeChanged event.



Implementation
    public function get size():uint

trackingCount

property 
trackingCount:uint  [read-only]

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

A number that increments every time the set of tracked services changes. Can be used to check whether there have been changes to the set of tracked services.

This property can be used as the source for data binding. When this property is modified, it dispatches the trackingCountChanged event.



Implementation
    public function get trackingCount():uint
Constructor Detail

ServiceTracker

()Constructor
public function ServiceTracker(context:IBundleContext, serviceInterface:Class, filter:IFilter = null, customizer:com.adobe.gravity.tracker:IServiceTrackerCustomizer = null)

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

Constructor.

Parameters
context:IBundleContext — A bundle context for performing service operations.
 
serviceInterface:Class — The interface for the services to be tracked.
 
filter:IFilter (default = null) — An optional filter to constrain the set of tracked services.
 
customizer:com.adobe.gravity.tracker:IServiceTrackerCustomizer (default = null) — An IServiceTrackerCustomizer with which to customize the behaviour of this tracker.
Method Detail

addingService

()method
public function addingService(reference:IServiceReference):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

Called when a new service appears that is to be tracked. Note that implementations of this method must retrieve the service object from the service registry. The simplest implementation would be

         public function addingService(reference:IServiceReference):IToken
         {
           return BundleContext.currentContext.getService(reference);
         }
         

Parameters

reference:IServiceReference — The reference for the new service.

Returns
com.adobe.gravity.utility.async:IToken — A token used to set success and failure handlers to be called when the operation has completed. The success handler must be called with the object to be returned by the tracker as the service object.

close

()method 
public function close():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

Stop tracking services.

modifiedService

()method 
public function modifiedService(reference:IServiceReference, service:Object):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

Called when service properties are modified.

Parameters

reference:IServiceReference — The reference for the service.
 
service:Object — The service object.

open

()method 
public function open():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

Start tracking services.

Returns
com.adobe.gravity.utility.async:IToken — A token used to set success and failure handlers to be called when the operation has completed. Success handlers will be called with no parameters.

removedService

()method 
public function removedService(reference:IServiceReference, service:Object):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

Called when a service is no longer to be tracked. Note that implementations must release the service object from the service registry. The simplest implementation would be

         public function removedService(reference:IServiceReference, service:Object):void
         {
           BundleContext.currentContext.ungetService(reference);
         }
         

Parameters

reference:IServiceReference
 
service:Object