public class ConstantInstanceProvider extends Object implements com.sun.star.bridge.XInstanceProvider
ConstantInstanceProvider is a component
that implements the XInstanceProvider Interface.XBridge,
XBridgeFactory,
XInstanceProvider,
JavaLoader| Modifier and Type | Field and Description |
|---|---|
protected Object |
_instance |
protected com.sun.star.lang.XMultiServiceFactory |
_serviceManager |
protected String |
_serviceName |
static boolean |
DEBUG
When set to true, enables various debugging output.
|
| Constructor and Description |
|---|
ConstantInstanceProvider(com.sun.star.lang.XMultiServiceFactory serviceManager)
Constructs a new
ConstantInstanceProvider. |
| Modifier and Type | Method and Description |
|---|---|
static com.sun.star.lang.XSingleServiceFactory |
__getServiceFactory(String implName,
com.sun.star.lang.XMultiServiceFactory multiFactory,
com.sun.star.registry.XRegistryKey regKey)
Gives a factory for creating the service.
|
Object |
getInstance(String sInstanceName)
Gives an object for the passed instance name.
|
void |
setInstance(String serviceName) |
public static final boolean DEBUG
protected com.sun.star.lang.XMultiServiceFactory _serviceManager
protected String _serviceName
protected Object _instance
public ConstantInstanceProvider(com.sun.star.lang.XMultiServiceFactory serviceManager)
ConstantInstanceProvider.
Uses the provided ServiceManager as the provided instance.
serviceManager - the provided service managerpublic static com.sun.star.lang.XSingleServiceFactory __getServiceFactory(String implName, com.sun.star.lang.XMultiServiceFactory multiFactory, com.sun.star.registry.XRegistryKey regKey)
This method is called by the JavaLoader.
implName - the name of the implementation for which a service is desired.multiFactory - the service manager to be uses if needed.regKey - the registryKey.XSingleServiceFactory for creating the component.JavaLoaderpublic void setInstance(String serviceName) throws com.sun.star.uno.Exception
com.sun.star.uno.Exceptionpublic Object getInstance(String sInstanceName) throws com.sun.star.container.NoSuchElementException, com.sun.star.uno.RuntimeException
getInstance in interface com.sun.star.bridge.XInstanceProvidersInstanceName - the name of the desired instancecom.sun.star.container.NoSuchElementExceptioncom.sun.star.uno.RuntimeException