Class ConstantInstanceProvider

  • All Implemented Interfaces:
    com.sun.star.bridge.XInstanceProvider, com.sun.star.uno.XInterface

    public class ConstantInstanceProvider
    extends java.lang.Object
    implements com.sun.star.bridge.XInstanceProvider
    The ConstantInstanceProvider is a component that implements the XInstanceProvider Interface.
    Since:
    UDK1.0
    See Also:
    XBridge, XBridgeFactory, XInstanceProvider, JavaLoader
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object _instance  
      protected com.sun.star.lang.XMultiServiceFactory _serviceManager  
      protected java.lang.String _serviceName  
      static boolean DEBUG
      When set to true, enables various debugging output.
      • Fields inherited from interface com.sun.star.bridge.XInstanceProvider

        UNOTYPEINFO
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantInstanceProvider​(com.sun.star.lang.XMultiServiceFactory serviceManager)
      Constructs a new ConstantInstanceProvider.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static com.sun.star.lang.XSingleServiceFactory __getServiceFactory​(java.lang.String implName, com.sun.star.lang.XMultiServiceFactory multiFactory, com.sun.star.registry.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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEBUG

        public static final boolean DEBUG
        When set to true, enables various debugging output.
        See Also:
        Constant Field Values
      • _serviceManager

        protected com.sun.star.lang.XMultiServiceFactory _serviceManager
      • _serviceName

        protected java.lang.String _serviceName
      • _instance

        protected java.lang.Object _instance
    • Constructor Detail

      • ConstantInstanceProvider

        public ConstantInstanceProvider​(com.sun.star.lang.XMultiServiceFactory serviceManager)
        Constructs a new ConstantInstanceProvider.

        Uses the provided ServiceManager as the provided instance.

        Parameters:
        serviceManager - the provided service manager
    • Method Detail

      • __getServiceFactory

        public static com.sun.star.lang.XSingleServiceFactory __getServiceFactory​(java.lang.String implName,
                                                                                  com.sun.star.lang.XMultiServiceFactory multiFactory,
                                                                                  com.sun.star.registry.XRegistryKey regKey)
        Gives a factory for creating the service.

        This method is called by the JavaLoader.

        Parameters:
        implName - the name of the implementation for which a service is desired.
        multiFactory - the service manager to be uses if needed.
        regKey - the registryKey.
        Returns:
        returns a XSingleServiceFactory for creating the component.
        See Also:
        JavaLoader
      • setInstance

        public void setInstance​(java.lang.String serviceName)
                         throws com.sun.star.uno.Exception
        Throws:
        com.sun.star.uno.Exception
      • getInstance

        public java.lang.Object getInstance​(java.lang.String sInstanceName)
                                     throws com.sun.star.container.NoSuchElementException,
                                            com.sun.star.uno.RuntimeException
        Gives an object for the passed instance name.
        Specified by:
        getInstance in interface com.sun.star.bridge.XInstanceProvider
        Parameters:
        sInstanceName - the name of the desired instance
        Returns:
        the desired instance
        Throws:
        com.sun.star.container.NoSuchElementException
        com.sun.star.uno.RuntimeException