:: com :: sun :: star :: lang ::

service ServiceManager
Description
Provides a collection of implementations for services. This is a singleton you commonly find in your component context under key /singletons/com.sun.star.lang.theServiceManager.

The factories are accessed with a service name. It is possible to access the factories with their implementation names, but you should avoid this.

Service factories added via ::com::sun::star::container::XSet should support the following interfaces:

XServiceInfo
supported interfaces/ implementation name
XSingleComponentFactory(optional)
is used to create instances of the implementation.
XComponent (optional)
The service manager calls the method XComponent::dispose on the factory when going down (i.e. it is commonly disposed by the component context).

Since LibreOffice 3.6, in addition to instances of XServiceInfo et al, the ::com::sun::star::container::XSet of at least the default C++ service manager implementation now also supports sequences of ::com::sun::star::beans::NamedValue in insert and remove. The sequence elements must each have a Name of uri and a string Value that is the URI of a service rdb. It is legal for there to be no such uri elements. For insert, there can additionally be an optional element with a Name of component-context and a value that is a non-null reference of type ::com::sun::star::uno::XComponentContext that shall be used instead of this service manager's default component context when loading the corresponding implementations.

See also
::com::sun::star::uno::XComponentContext
Developers Guide
ProUNO - Service Manager and Component Context
FirstSteps - First Contact - Getting Started
ProUNO - Bridge - The Service Manager Component - Instantiation
ProUNO - Basic - Instantiating UNO Services
ProUNO - Java - Getting a Service Manager
AdvUNO - Implementing UNO Language Bindings - Overview of Language Bindings and Bridges - Bootstrapping
ProUNO - C++ - Establishing Interprocess Connections
ProUNO - UNO Interprocess Connections

Included Services - Summary
MultiServiceFactory

This is a derived MultiServiceFactory service.

Exported Interfaces - Summary
XComponent

Disposing of service manager. (details)

::com::sun::star::container::XSet

Management of service factories.

::com::sun::star::container::XContentEnumerationAccess

Enumeration of all service factories. (details)

::com::sun::star::beans::XPropertySet

Property access. (details)

Properties' Summary
::com::sun::star::uno::XComponentContext
DefaultContext
[ OPTIONAL ]
specifies the default component context to be used, if instanciating services via XMultiServiceFactory  
Included Services - Details
MultiServiceFactory
Description
This is a derived MultiServiceFactory service.
Exported Interfaces - Details
XComponent
Description
Disposing of service manager.

The component context disposes its service manager singleton when going down (i.e. when the component context is disposed).

::com::sun::star::container::XSet
Description
Management of service factories.
::com::sun::star::container::XContentEnumerationAccess
Description
Enumeration of all service factories.

It is possible to enumerate all implementations that support the service specified with the argument of the ::com::sun::star::container::XContentEnumerationAccess::createContentEnumeration method. The enumerator commonly returns XSingleComponentFactory interfaces.

::com::sun::star::beans::XPropertySet
Usage Restrictions
optional
Description
Property access.
Properties' Details
DefaultContext
::com::sun::star::uno::XComponentContext DefaultContext;
Usage Restrictions
optional
Description
specifies the default component context to be used, if instanciating services via XMultiServiceFactory

 
Top of Page