Class Bootstrap


  • public class Bootstrap
    extends java.lang.Object
    Bootstrap offers functionality to obtain a context or simply a service manager. The service manager can create a few basic services, whose implementations are:
    • com.sun.star.comp.loader.JavaLoader
    • com.sun.star.comp.urlresolver.UrlResolver
    • com.sun.star.comp.bridgefactory.BridgeFactory
    • com.sun.star.comp.connections.Connector
    • com.sun.star.comp.connections.Acceptor
    • com.sun.star.comp.servicemanager.ServiceManager
    Other services can be inserted into the service manager by using its XSet interface:
            XSet xSet = UnoRuntime.queryInterface( XSet.class, aMultiComponentFactory );
            // insert the service manager
            xSet.insert( aSingleComponentFactory );
        
    • Constructor Summary

      Constructors 
      Constructor Description
      Bootstrap()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.sun.star.uno.XComponentContext bootstrap()
      Bootstraps the component context from a UNO installation.
      static com.sun.star.uno.XComponentContext bootstrap​(java.lang.String[] argArray)
      Bootstraps the component context from a UNO installation.
      static com.sun.star.uno.XComponentContext createInitialComponentContext​(java.util.Hashtable<java.lang.String,​java.lang.Object> context_entries)
      backwards compatibility stub.
      static com.sun.star.uno.XComponentContext createInitialComponentContext​(java.util.Map<java.lang.String,​java.lang.Object> context_entries)
      Bootstraps an initial component context with service manager and basic jurt components inserted.
      static com.sun.star.lang.XMultiServiceFactory createSimpleServiceManager()
      Bootstraps a servicemanager with the jurt base components registered.
      static com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext()
      Bootstraps the initial component context from a native UNO installation.
      static com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext​(java.lang.String ini_file, java.util.Hashtable<java.lang.String,​java.lang.String> bootstrap_parameters)
      Backwards compatibility stub.
      static com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext​(java.lang.String ini_file, java.util.Map<java.lang.String,​java.lang.String> bootstrap_parameters)
      Bootstraps the initial component context from a native UNO installation.
      static java.lang.String[] getDefaultOptions()
      Returns an array of default commandline options to start bootstrapped instance of soffice with.
      • Methods inherited from class java.lang.Object

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

      • Bootstrap

        public Bootstrap()
    • Method Detail

      • getDefaultOptions

        public static final java.lang.String[] getDefaultOptions()
        Returns an array of default commandline options to start bootstrapped instance of soffice with. You may use it in connection with bootstrap method for example like this:
             List list = Arrays.asList( Bootstrap.getDefaultOptions() );
             list.remove("--nologo");
             list.remove("--nodefault");
             list.add("--invisible");
        
             Bootstrap.bootstrap( list.toArray( new String[list.size()] );
         
        Returns:
        an array of default commandline options
        Since:
        LibreOffice 5.1
        See Also:
        bootstrap( String[] )
      • createInitialComponentContext

        public static com.sun.star.uno.XComponentContext createInitialComponentContext​(java.util.Hashtable<java.lang.String,​java.lang.Object> context_entries)
                                                                                throws java.lang.Exception
        backwards compatibility stub.
        Parameters:
        context_entries - the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).
        Returns:
        a new context.
        Throws:
        java.lang.Exception - if things go awry.
      • createInitialComponentContext

        public static com.sun.star.uno.XComponentContext createInitialComponentContext​(java.util.Map<java.lang.String,​java.lang.Object> context_entries)
                                                                                throws java.lang.Exception
        Bootstraps an initial component context with service manager and basic jurt components inserted.
        Parameters:
        context_entries - the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).
        Returns:
        a new context.
        Throws:
        java.lang.Exception - if things go awry.
      • createSimpleServiceManager

        public static com.sun.star.lang.XMultiServiceFactory createSimpleServiceManager()
                                                                                 throws java.lang.Exception
        Bootstraps a servicemanager with the jurt base components registered. See also UNOIDL com.sun.star.lang.ServiceManager.
        Returns:
        a freshly bootstrapped service manager
        Throws:
        java.lang.Exception - if things go awry.
      • defaultBootstrap_InitialComponentContext

        public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext()
                                                                                                 throws java.lang.Exception
        Bootstraps the initial component context from a native UNO installation.
        Returns:
        a freshly bootstrapped component context. See also cppuhelper/defaultBootstrap_InitialComponentContext().
        Throws:
        java.lang.Exception - if things go awry.
      • defaultBootstrap_InitialComponentContext

        public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext​(java.lang.String ini_file,
                                                                                                        java.util.Hashtable<java.lang.String,​java.lang.String> bootstrap_parameters)
                                                                                                 throws java.lang.Exception
        Backwards compatibility stub.
        Parameters:
        ini_file - ini_file (may be null: uno.rc besides cppuhelper lib)
        bootstrap_parameters - bootstrap parameters (maybe null)
        Returns:
        a freshly bootstrapped component context.
        Throws:
        java.lang.Exception - if things go awry.
      • defaultBootstrap_InitialComponentContext

        public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext​(java.lang.String ini_file,
                                                                                                        java.util.Map<java.lang.String,​java.lang.String> bootstrap_parameters)
                                                                                                 throws java.lang.Exception
        Bootstraps the initial component context from a native UNO installation. See also cppuhelper/defaultBootstrap_InitialComponentContext().
        Parameters:
        ini_file - ini_file (may be null: uno.rc besides cppuhelper lib)
        bootstrap_parameters - bootstrap parameters (maybe null)
        Returns:
        a freshly bootstrapped component context.
        Throws:
        java.lang.Exception - if things go awry.
      • bootstrap

        public static final com.sun.star.uno.XComponentContext bootstrap()
                                                                  throws BootstrapException
        Bootstraps the component context from a UNO installation.
        Returns:
        a bootstrapped component context.
        Throws:
        BootstrapException - if things go awry.
        Since:
        UDK 3.1.0
      • bootstrap

        public static final com.sun.star.uno.XComponentContext bootstrap​(java.lang.String[] argArray)
                                                                  throws BootstrapException
        Bootstraps the component context from a UNO installation.
        Parameters:
        argArray - an array of strings - commandline options to start instance of soffice with
        Returns:
        a bootstrapped component context.
        Throws:
        BootstrapException - if things go awry.
        Since:
        LibreOffice 5.1
        See Also:
        getDefaultOptions()