service ServiceManager in module com::sun::star::lang:: |
service ServiceManager;
provides a collection of implementations for services.
The factories are accessed with a service name. It is possible to access the factories with their implementation names, but you should avoid this.
The interfaces added through the XSet interfaces should support the following interfaces:
Included Services |
Exported Interfaces |
Normally you should call the method XComponent::dispose at the service manager just before the application terminates.
The service manager first broadcasts the XEventListener::disposing() message to all registered listeners. In this state you can still get all factories from the service manager, but it is not possible to add disposing listeners. Second the service manager calls XComponent::dispose at all registered factories that implement XComponent . In this second state the service manager does not provide any factory. This is called a two-phase shut down.
The implementations are managed with this interface. The supported services ( XServiceInfo is used) are registered automatically.
It is possible to enumerate all implementations that support the service specified with the argument of the XContentEnumerationAccess::createContentEnumeration method.
The enumerator returns interfaces. The type of interfaces are not specified. Normally these are XSingleServiceFactory .
Use a service name or an implementation name to instanciate a component with this interface.
First the service manager gets the factory registered under the service name. Then XMultiServiceFactory::createInstance or XMultiServiceFactory::createInstanceWithArguments of this factory is called.
Services should always support this interface. For a RegistryServiceManager , at least the service "com.sun.star.lang.RegistryServiceManager" must be supported.
Copyright 2001 OpenOffice.org Foundation. All Rights Reserved.