Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
getServiceByContractID
Returns the instance that implements aClass or aContractID and the interface aIID. This may result in the instance being created.
or aContractID : aClass or aContractID of object instance requested
: IID of interface requested
: resulting service
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.
NS_NOINTERFACE if the IID given isn't supported by the object
or aContractID : aClass or aContractID of object instance requested
: IID of interface requested
Generated using TypeDoc
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.