Interface nsIServiceManagerType

The nsIServiceManager manager interface provides a means to obtain global services in an application. The service manager depends on the repository to find and instantiate factories to obtain services.

Users of the service manager must first obtain a pointer to the global service manager by calling NS_GetServiceManager. After that, they can request specific services by calling GetService. When they are finished they can NS_RELEASE() the service as usual.

A user of a service may keep references to particular services indefinitely and only must call Release when it shuts down.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • getServiceByContractID

    Returns the instance that implements aClass or aContractID and the interface aIID. This may result in the instance being created.

    Parameters

    • aClass: object

      or aContractID : aClass or aContractID of object instance requested

    • aIID: object

      : IID of interface requested

    • result: object

      : resulting service

    Returns void

  • Parameters

    • aContractID: string
    • aIID: object
    • result: object

    Returns void

  • isServiceInstantiated

    isServiceInstantiated will return a true if the service has already been created, or false otherwise. Throws if the service does not implement the given IID.

    Throws

    NS_NOINTERFACE if the IID given isn't supported by the object

    Parameters

    • aClass: object

      or aContractID : aClass or aContractID of object instance requested

    • aIID: object

      : IID of interface requested

    Returns boolean

  • Parameters

    • aContractID: string
    • aIID: object

    Returns boolean

Generated using TypeDoc