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