Interface ServiceFactory<ExpectedServiceType>

A factory for creating services.

A service factory is a way to create different service instances for different bundles. For this instead of registering a service instance register a ServiceFactory implementation.

interface ServiceFactory<ExpectedServiceType> {
    getService(bundle, registration): ExpectedServiceType;
    isServiceCreated?(bundle, registration): boolean;
    ungetService(bundle, registration, instance): void;
}

Type Parameters

Methods

  • Returns true if a service has already been created, or false otherwise.

    Parameters

    • bundle: Bundle

      The bundle which like to use the service.

    • registration: ServiceRegistration

      The service registration information.

    Returns boolean

  • Releases a service instance.

    Parameters

    Returns void

Generated using TypeDoc