Top Description Fields Constructors Methods
com.sun.star.comp.helper

public Class Bootstrap

extends Object
Class Inheritance
Imports
com.sun.star.bridge.UnoUrlResolver, com.sun.star.bridge.XUnoUrlResolver, com.sun.star.comp.loader.JavaLoader, com.sun.star.comp.servicemanager.ServiceManager, com.sun.star.container.XSet, com.sun.star.lang.XInitialization, com.sun.star.lang.XMultiServiceFactory, com.sun.star.lang.XMultiComponentFactory, com.sun.star.lib.util.NativeLibraryLoader, com.sun.star.loader.XImplementationLoader, com.sun.star.uno.UnoRuntime, com.sun.star.uno.XComponentContext, com.sun.star.beans.XPropertySet, java.io.BufferedReader, .File, .InputStream, .InputStreamReader, .PrintStream, .UnsupportedEncodingException, java.util.HashMap, .Hashtable, .Map, .Random

Bootstrap offers functionality to obtain a context or simply a service manager. The service manager can create a few basic services, whose implementations are: 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 );

Field Summary

Modifier and TypeField and Description
private static boolean
private static final Random

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final com.sun.star.uno.XComponentContext

Returns:

a bootstrapped component context.
bootstrap
()

Bootstraps the component context from a UNO installation.

public static final com.sun.star.uno.XComponentContext

Returns:

a bootstrapped component context.
bootstrap
(String[]
an array of strings - commandline options to start instance of soffice with
argArray
)

Bootstraps the component context from a UNO installation.

public static final com.sun.star.uno.XComponentContext

Returns:

a bootstrapped component context.
bootstrapWebsocketConnection
(String
the ws:// or wss:// url of the websocket server
url
)

Bootstraps the component context from a websocket location.

private static native Object
cppuhelper_bootstrap(String ini_file, String[] bootstrap_parameters, ClassLoader loader)

public static com.sun.star.uno.XComponentContext

Returns:

a new context.
createInitialComponentContext
(Hashtable<String, Object>
the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).
context_entries
)

backwards compatibility stub.

public static com.sun.star.uno.XComponentContext

Returns:

a new context.
createInitialComponentContext
(Map<String, Object>
the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).
context_entries
)

Bootstraps an initial component context with service manager and basic jurt components inserted.

public static com.sun.star.lang.XMultiServiceFactory

Returns:

a freshly bootstrapped service manager
createSimpleServiceManager
()

Bootstraps a servicemanager with the jurt base components registered.

public static final com.sun.star.uno.XComponentContext

Returns:

a freshly bootstrapped component context. See also cppuhelper/defaultBootstrap_InitialComponentContext().
defaultBootstrap_InitialComponentContext
()

Bootstraps the initial component context from a native UNO installation.

public static final com.sun.star.uno.XComponentContext

Returns:

a freshly bootstrapped component context.
defaultBootstrap_InitialComponentContext
(String
ini_file (may be null: uno.rc besides cppuhelper lib)
ini_file
,
Hashtable<String, String>
bootstrap parameters (maybe null)
bootstrap_parameters
)

Backwards compatibility stub.

public static final com.sun.star.uno.XComponentContext

Returns:

a freshly bootstrapped component context.
defaultBootstrap_InitialComponentContext
(String
ini_file (may be null: uno.rc besides cppuhelper lib)
ini_file
,
Map<String, String>
bootstrap parameters (maybe null)
bootstrap_parameters
)

Bootstraps the initial component context from a native UNO installation.

public static final String[]

Returns:

an array of default commandline options
getDefaultOptions
()

Returns an array of default commandline options to start bootstrapped instance of soffice with.

private static void
insertBasicFactories(com.sun.star.container.XSet xSet, com.sun.star.loader.XImplementationLoader xImpLoader)

private static void
pipe(final InputStream in, final PrintStream out, final String prefix)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_loaded_juhback to summary
private static boolean m_loaded_juh
randomPipeNameback to summary
private static final Random randomPipeName

Constructor Detail

Bootstrapback to summary
public Bootstrap()

Method Detail

bootstrapback to summary
public static final com.sun.star.uno.XComponentContext bootstrap() throws BootstrapException

Bootstraps the component context from a UNO installation.

Returns:com.sun.star.uno.XComponentContext

a bootstrapped component context.

Exceptions
BootstrapException:
if things go awry.
Since
UDK 3.1.0
bootstrapback to summary
public static final com.sun.star.uno.XComponentContext bootstrap(String[] argArray) throws BootstrapException

Bootstraps the component context from a UNO installation.

Parameters
argArray:String[]

an array of strings - commandline options to start instance of soffice with

Returns:com.sun.star.uno.XComponentContext

a bootstrapped component context.

Exceptions
BootstrapException:
if things go awry.
Since
LibreOffice 5.1
See Also
getDefaultOptions()
bootstrapWebsocketConnectionback to summary
public static final com.sun.star.uno.XComponentContext bootstrapWebsocketConnection(String url) throws BootstrapException

Bootstraps the component context from a websocket location.

Parameters
url:String

the ws:// or wss:// url of the websocket server

Returns:com.sun.star.uno.XComponentContext

a bootstrapped component context.

Exceptions
BootstrapException:
if things go awry.
Since
LibreOffice 24.2
cppuhelper_bootstrapback to summary
private static native Object cppuhelper_bootstrap(String ini_file, String[] bootstrap_parameters, ClassLoader loader) throws Exception
createInitialComponentContextback to summary
public static com.sun.star.uno.XComponentContext createInitialComponentContext(Hashtable<String, Object> context_entries) throws Exception

backwards compatibility stub.

Parameters
context_entries:Hashtable<String, Object>

the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).

Returns:com.sun.star.uno.XComponentContext

a new context.

Exceptions
Exception:
if things go awry.
createInitialComponentContextback to summary
public static com.sun.star.uno.XComponentContext createInitialComponentContext(Map<String, Object> context_entries) throws Exception

Bootstraps an initial component context with service manager and basic jurt components inserted.

Parameters
context_entries:Map<String, Object>

the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry).

Returns:com.sun.star.uno.XComponentContext

a new context.

Exceptions
Exception:
if things go awry.
createSimpleServiceManagerback to summary
public static com.sun.star.lang.XMultiServiceFactory createSimpleServiceManager() throws Exception

Bootstraps a servicemanager with the jurt base components registered. See also UNOIDL com.sun.star.lang.ServiceManager.

Returns:com.sun.star.lang.XMultiServiceFactory

a freshly bootstrapped service manager

Exceptions
Exception:
if things go awry.
defaultBootstrap_InitialComponentContextback to summary
public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext() throws Exception

Bootstraps the initial component context from a native UNO installation.

Returns:com.sun.star.uno.XComponentContext

a freshly bootstrapped component context. See also cppuhelper/defaultBootstrap_InitialComponentContext().

Exceptions
Exception:
if things go awry.
defaultBootstrap_InitialComponentContextback to summary
public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext(String ini_file, Hashtable<String, String> bootstrap_parameters) throws Exception

Backwards compatibility stub.

Parameters
ini_file:String

ini_file (may be null: uno.rc besides cppuhelper lib)

bootstrap_parameters:Hashtable<String, String>

bootstrap parameters (maybe null)

Returns:com.sun.star.uno.XComponentContext

a freshly bootstrapped component context.

Exceptions
Exception:
if things go awry.
defaultBootstrap_InitialComponentContextback to summary
public static final com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext(String ini_file, Map<String, String> bootstrap_parameters) throws Exception

Bootstraps the initial component context from a native UNO installation. See also cppuhelper/defaultBootstrap_InitialComponentContext().

Parameters
ini_file:String

ini_file (may be null: uno.rc besides cppuhelper lib)

bootstrap_parameters:Map<String, String>

bootstrap parameters (maybe null)

Returns:com.sun.star.uno.XComponentContext

a freshly bootstrapped component context.

Exceptions
Exception:
if things go awry.
getDefaultOptionsback to summary
public static final 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:String[]

an array of default commandline options

Since
LibreOffice 5.1
See Also
bootstrap(String[])
insertBasicFactoriesback to summary
private static void insertBasicFactories(com.sun.star.container.XSet xSet, com.sun.star.loader.XImplementationLoader xImpLoader) throws Exception
pipeback to summary
private static void pipe(final InputStream in, final PrintStream out, final String prefix)