
nsIServiceManager
This interface provides a means to obtain global services (ie, access to a singleton object) in an application. The service manager depends on the registry 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 callingGetService. When they are finished they shouldNS_RELEASEthe service as usual. A user of a service may keep references to particular services indefinitely and must callReleaseonly when it shuts down. This interface is scriptable.Returns the object that implements
aClassand the interfaceaIID. This may result in the object being created.Syntax:
void nsIServiceManager::getService(in nsCIDRef aClass, in nsIIDRef aIID, [iid_is(aIID),retval] out nsQIResult result)Parameters:
nsresult:
Returns the object that implements
aContractIDand the interfaceaIID. This may result in the instance being created.Syntax:
void nsIServiceManager::getServiceByContractID( in string aContractID, in nsIIDRef aIID, [iid_is(aIID),retval] out nsQIResult result)Parameters:
nsresult:
Returns
TRUEif the singleton service object has already been created.Syntax:
boolean nsIServiceManager::isServiceInstantiated( in nsCIDRef aClass,in nsIIDRef aIID)Parameters:
Return:
Returns
TRUEif the singleton service object has already been created.Syntax:
boolean nsIServiceManager::isServiceInstantiated( in string aContractID,in nsIIDRef aIID)Parameters:
nsresult:
| Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |