ServiceManager class is an implementation of the
ServiceManagerthe central class needed for implementing or using
UNO components in Java.
The Methods queryInterface and isSame delegate
calls to the implementing objects and are used instead of casts and identity
comparisons.
com.sun.star.lang.XMultiServiceFactory , com.sun.star.container.XSet , com.sun.star.container.XContentEnumerationAccess , com.sun.star.lang.XComponent , com.sun.star.lang.XServiceInfo
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ServiceManager.
The |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| pack-priv ArrayList | |
| pack-priv HashMap | |
| pack-priv HashMap | |
| private com. | |
| pack-priv static String[] | |
| private static Type |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addEventListener(com.
the new listener which should been added. xListenerAdds a new |
| public com. | Returns: an enumeration for service name.name of the requested service. serviceName)Provides an enumeration of all factories for a specified service. |
| public com. | Returns: an enumeration of all available services.Provides an enumeration of all registered services. |
| public Object | Returns: newly created component.indicates the service or component name. serviceSpecifier)Creates a new instance of a specified service. |
| public Object | Returns: newly created component.indicates the service or component name. serviceSpecifier, Object[] args)Creates a new instance of a specified service with the given parameters. |
| public Object | Returns: service instance.service name. rServiceSpecifier, Object[] arguments. rArguments, com.context. xContextCreate a service instance with given context and arguments. |
| public Object | Returns: service instance.service name. rServiceSpecifier, com.context. xContextCreate a service instance with given context. |
| private static final void | |
| public void | |
| public String[] | Returns: list of Strings of all service names.Supplies a list of all available services names. |
| public Type | Returns: the UNO type of theServiceManager.Provides the UNO type of the |
| public String | Returns: the class name of theServiceManager.Returns the implementation name of the |
| public String[] | Returns: a list of all supported service names.Supplies list of all supported services. |
| public boolean | |
| public boolean | Returns: true - if the list of the registered components is not empty - otherwise false.Checks if the any components are registered. |
| public void | |
| private Object | Returns: the factory of the service / implementation.indicates the service or implementation name. serviceName)Look up the factory for a given service or implementation name. |
| public void | |
| public void | removeEventListener(com.
the new listener which should been removed. xListenerRemoves a |
| public void | |
| public boolean | Returns: true if the service is supported - otherwise false.service name which should be checked. serviceName)Checks if the |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| eventListener | back to summary |
|---|---|
| pack-priv ArrayList<com. | |
| factoriesByImplNames | back to summary |
|---|---|
| pack-priv HashMap<String, Object> factoriesByImplNames | |
| factoriesByServiceNames | back to summary |
|---|---|
| pack-priv HashMap<String, ArrayList<Object>> factoriesByServiceNames | |
| m_xDefaultContext | back to summary |
|---|---|
| private com. | |
| supportedServiceNames | back to summary |
|---|---|
| pack-priv static String[] supportedServiceNames | |
| UNO_TYPE | back to summary |
|---|---|
| private static Type UNO_TYPE | |
| ServiceManager | back to summary |
|---|---|
| public ServiceManager() Creates a new instance of the | |
| addEventListener | back to summary |
|---|---|
| public void addEventListener(com. Adds a new The listener is notified when a service is added (removed) to (from)
the If the listener is already registered a
| |
| createContentEnumeration | back to summary |
|---|---|
| public com. Provides an enumeration of all factories for a specified service.
| |
| createEnumeration | back to summary |
|---|---|
| public com. Provides an enumeration of all registered services.
| |
| createInstance | back to summary |
|---|---|
| public Object createInstance(String serviceSpecifier) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException Creates a new instance of a specified service. Therefore the associated factory of the service is looked up and used to instantiate a new component.
| |
| createInstanceWithArguments | back to summary |
|---|---|
| public Object createInstanceWithArguments(String serviceSpecifier, Object[] args) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException Creates a new instance of a specified service with the given parameters. Therefore the associated factory of the service is looked up and used to instantiate a new component.
| |
| createInstanceWithArgumentsAndContext | back to summary |
|---|---|
| public Object createInstanceWithArgumentsAndContext(String rServiceSpecifier, Object[] rArguments, com. Create a service instance with given context and arguments. | |
| createInstanceWithContext | back to summary |
|---|---|
| public Object createInstanceWithContext(String rServiceSpecifier, com. Create a service instance with given context. | |
| DEBUG | back to summary |
|---|---|
| private static final void DEBUG(String dbg) | |
| dispose | back to summary |
|---|---|
| public void dispose() throws com.sun.star.uno.RuntimeException Removes all listeners from the
| |
| getAvailableServiceNames | back to summary |
|---|---|
| public String[] getAvailableServiceNames() throws com.sun.star.uno.RuntimeException Supplies a list of all available services names.
| |
| getElementType | back to summary |
|---|---|
| public Type getElementType() throws com.sun.star.uno.RuntimeException Provides the UNO type of the
| |
| getImplementationName | back to summary |
|---|---|
| public String getImplementationName() throws com.sun.star.uno.RuntimeException Returns the implementation name of the
| |
| getSupportedServiceNames | back to summary |
|---|---|
| public String[] getSupportedServiceNames() throws com.sun.star.uno.RuntimeException Supplies list of all supported services.
| |
| has | back to summary |
|---|---|
| public boolean has(Object object) throws com.sun.star.uno.RuntimeException Checks if a component is registered at the The given object argument must provide a
| |
| hasElements | back to summary |
|---|---|
| public boolean hasElements() Checks if the any components are registered.
| |
| insert | back to summary |
|---|---|
| public void insert(Object object) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.container.ElementExistException, com.sun.star.uno.RuntimeException Adds a
| |
| queryServiceFactory | back to summary |
|---|---|
| private Object queryServiceFactory(String serviceName) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException Look up the factory for a given service or implementation name. First the requested service name is search in the list of available services. If it can not be found the name is looked up in the implementation list.
| |
| remove | back to summary |
|---|---|
| public void remove(Object object) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.container.NoSuchElementException, com.sun.star.uno.RuntimeException Removes a
| |
| removeEventListener | back to summary |
|---|---|
| public void removeEventListener(com. Removes a If the listener is not registered a
| |
| setDefaultContext | back to summary |
|---|---|
| public void setDefaultContext(com. | |
| supportsService | back to summary |
|---|---|
| public boolean supportsService(String serviceName) throws com.sun.star.uno.RuntimeException Checks if the
| |
ServiceEnumerationImpl class provides an
implementation of the @see com.sun.star.container.XEnumeration interface.
It is an inner wrapper for a java.util.Enumeration object.
com.sun.star.lang.XSingleServiceFactory , com.sun.star.lang.XServiceInfo
| Access | Constructor and Description |
|---|---|
| public | |
| public | ServiceEnumerationImpl(Enumeration<Object>
is the enumeration which should been wrapped. enumer)Constructs a new instance with a given enumeration. |
| public | ServiceEnumerationImpl(Iterator<Object>
is the enumeration which should been wrapped. enumer)Constructs a new instance with a given enumeration. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if more elements are available - otherwise false.Checks if the enumeration contains more elements. |
| public Object |
| enumeration | back to summary |
|---|---|
| pack-priv Iterator<Object> enumeration | |
| ServiceEnumerationImpl | back to summary |
|---|---|
| public ServiceEnumerationImpl() Constructs a new empty instance. | |
| ServiceEnumerationImpl | back to summary |
|---|---|
| public ServiceEnumerationImpl(Enumeration<Object> enumer) Constructs a new instance with a given enumeration.
| |
| ServiceEnumerationImpl | back to summary |
|---|---|
| public ServiceEnumerationImpl(Iterator<Object> enumer) Constructs a new instance with a given enumeration.
| |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() throws com.sun.star.uno.RuntimeException Checks if the enumeration contains more elements.
| |
| nextElement | back to summary |
|---|---|
| public Object nextElement() throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException, com.sun.star.uno.RuntimeException Returns the next element of the enumeration. If no further elements available a com.sun.star.container.NoSuchElementException exception will be thrown.
| |