Class Index | File Index

Classes


Class orion.ServiceTracker

Simplifies the use of services within a service registry.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.core/web/orion/serviceTracker.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
orion.ServiceTracker(serviceRegistry, objectClass)
Creates a ServiceTracker against the given service registry.
Method Summary
Method Attributes Method Name and Description
 
addingService(serviceRef)
Called to customize a service object being added to this ServiceTracker.
 
Stops tracking services.
 
Returns service references to the services that are being tracked.
 
Called when this ServiceTracker has been closed.
 
Called when this ServiceTracker has been opened.
 
onServiceAdded(serviceRef, service)
Called when a service is being added to this ServiceTracker.
 
open(all)
Begins tracking services.
 
removedService(serviceRef, service)
Called when a service has been removed from this ServiceTracker.
Class Detail
orion.ServiceTracker(serviceRegistry, objectClass)
Creates a ServiceTracker against the given service registry. The returned ServiceTracker will track services whose objectClass property contains the given objectClass parameter.

After creating a ServiceTracker, it can then be #opened to begin tracking services.

The #addingService and #removedService methods can be overridden to customize the service objects being tracked.

Parameters:
{orion.serviceregistry.ServiceRegistry} serviceRegistry
The service registry to track services of.
{String} objectClass
The objectClass of services to be tracked.
Method Detail
{Object} addingService(serviceRef)
Called to customize a service object being added to this ServiceTracker. Subclasses may override this method. The default implementation returns the result of calling orion.serviceregistry.ServiceRegistry#getService passing the service reference.
Parameters:
{orion.serviceregistry.ServiceReference} serviceRef
The reference to the service being added.
Returns:
{Object} The service object to be tracked for the given service reference. If null is returned, the service reference will not be tracked.

close()
Stops tracking services.

{orion.serviceregistry.ServiceReference[]} getServiceReferences()
Returns service references to the services that are being tracked.
Returns:
{orion.serviceregistry.ServiceReference[]} References to all services that are being tracked by this ServiceTracker.

onClose()
Called when this ServiceTracker has been closed. Subclasses can override this method.

onOpen()
Called when this ServiceTracker has been opened. Subclasses can override this method.

{orion.Promise|undefined} onServiceAdded(serviceRef, service)
Called when a service is being added to this ServiceTracker. Subclasses can override this method to take part in the service's 'serviceAdded' phase.
Parameters:
{orion.serviceregistry.ServiceReference} serviceRef
The service reference for the service that is being added.
{Object} service
The service implementation object that is being added.
Returns:
{orion.Promise|undefined} This method can optionally return a deferred. If it does, the returned deferred will be added to the service's serviceAdded listener queue; in other words, the returned deferred must resolve before any calls to the service's methods can proceed.

open(all)
Begins tracking services.
Parameters:
{Boolean} all Optional, Default: true
When true, this ServiceTracker receives an initial block of serviceAdded calls for any services currently present in the registry, and then for any subsequent registrations. When false, this ServiceTracker is invoked only for subsequent serviceAdded events.

Clients can use all === false when they wish to respond only to future events, and all === true when they wish to quickly "catch up" with trackable services that were registered prior to #open being called.


removedService(serviceRef, service)
Called when a service has been removed from this ServiceTracker. Subclasses may override this method. The default implementation does nothing.
Parameters:
{orion.serviceregistry.ServiceReference} serviceRef
The reference to the removed service.
{Object} service
The service implementation object for the removed service.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jun 29 2017 14:37:22 GMT-0400 (EDT)