IBM Rational Software Modeler
Release 6.0

Package com.ibm.xtools.common.core.service

Base service provider API.

See:
          Description

Interface Summary
IOperation The interface for all service provider operations.
IProvider The interface for all service providers.
IProviderChangeListener An interface for types that listen to service provider changes.
IProviderPolicy The interface for all service providers lightweight's implementation.
 

Class Summary
AbstractProvider The abstract parent of all service providers.
ProviderChangeEvent An event that indicates when a provider changes.
 

Package com.ibm.xtools.common.core.service Description

Base service provider API. The following examples are some of the services in the modeling platform:

The modeling platform consists of a set of services whose requests are fulfilled by service providers that implement IProvider. Each service exposes an extension-point that providers extend to be discovered and used. This package contains classes that define the abstract contract for service providers.

Package Specification

When it receives a client request, a service typically embeds the request information in an IOperation and then evaluates the extensions of its defined extension-point to find potential providers for the request. To determine to which providers to delegate a request, a service uses two sequential filters:

  1. The service evaluates the information in each provider's extension descriptor. The service extension-point schema typically filters out most providers in this step and prevents the unnecessary loading of a provider.
  2. The service requests information from each provider about whether it can support the request. The provider's IProvider.provides implementation performs this action.

Typically, the service sorts the providers that passed the filters according to the priority that the service provider extension descriptor defines. Depending on the service and the request, the service might request one or more providers to perform the operation. After the required providers are defined, the service delegates the execution of the request for each provider to the operation's IOperation.execute implementation. Each service provides its own IOperation subclass that subsequently delegates to the provider.

Most services expose an abstract class implementing IProvider that providers should subclass. The abstract class specifies the contract between the service and its providers since it specifies the API to perform requests. The abstract class usually extends AbstractProvider to leverage the notification support of this class.

Some services require notification from a provider if the provider's state changes. This notification occurs through the IProviderChangeListener interface. These types of service connect to their provider using addProviderChangeListener and disconnect using removeProviderChangeListener. Services often provide their own derived ProviderChangeEvent classes to convey more service-specific information about the state change.

Sometimes, it is impossible to provide enough information in a service provider extension descriptor to avoid the unnecessary loading of the provider plug-in. When the cost of loading a provider plug-in is high, it might be preferable to move the implementation of IProvider.provides to a lightweight plug-in. To do this, a service provider extension descriptor should include a "Policy" subelement with a class attribute that references a class that implements IProviderPolicy. This interface is a subset of IProvider that only includes the IProviderPolicy.provides member.


IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.