Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.openoffice

public Class Bootstrap

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .InputStream, .InputStreamReader, .PrintStream, java.nio.charset.StandardCharsets, java.nio.file.Path, java.util.HashMap, .Hashtable, .Map, .Random, com.sun.star.bridge.UnoUrlResolver, com.sun.star.bridge.XUnoUrlResolver, com.sun.star.comp.helper.BootstrapException, .ComponentContext, .ComponentContextEntry, com.sun.star.comp.loader.JavaLoader, com.sun.star.comp.servicemanager.ServiceManager, com.sun.star.connection.NoConnectException, com.sun.star.container.ElementExistException, com.sun.star.container.XSet, com.sun.star.lang.XInitialization, com.sun.star.lang.XMultiComponentFactory, com.sun.star.lang.XMultiServiceFactory, com.sun.star.lib.util.NativeLibraryLoader, com.sun.star.loader.CannotActivateFactoryException, com.sun.star.loader.XImplementationLoader, com.sun.star.uno.Exception, com.sun.star.uno.UnoRuntime, com.sun.star.uno.XComponentContext

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 );
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 com.sun.star.uno.XComponentContext

Returns:

a bootstrapped component context.
bootstrap
(Path ooPath)

Bootstraps the component context from a UNO installation.

public static 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
,
Path path)

Bootstraps the component context from a UNO installation.

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 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 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 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 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
RANDOM_PIPE_NAMEback to summary
private static final Random RANDOM_PIPE_NAME

Constructor Detail

Bootstrapback to summary
public Bootstrap()

Method Detail

bootstrapback to summary
public static com.sun.star.uno.XComponentContext bootstrap(Path ooPath) throws BootstrapException, IOException, InterruptedException

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 com.sun.star.uno.XComponentContext bootstrap(String[] argArray, Path path) throws BootstrapException, IOException, InterruptedException

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()
cppuhelper_bootstrapback to summary
private static native Object cppuhelper_bootstrap(String ini_file, String[] bootstrap_parameters, ClassLoader loader)
createInitialComponentContextback to summary
public static com.sun.star.uno.XComponentContext createInitialComponentContext(Hashtable<String, Object> context_entries) throws com.sun.star.uno.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
OOError.fromMisc(Exception):
if things go awry.
createInitialComponentContextback to summary
public static com.sun.star.uno.XComponentContext createInitialComponentContext(Map<String, Object> context_entries) throws com.sun.star.uno.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
OOError.fromMisc(Exception):
if things go awry.
createSimpleServiceManagerback to summary
public static com.sun.star.lang.XMultiServiceFactory createSimpleServiceManager() throws com.sun.star.uno.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
OOError.fromMisc(Exception):
if things go awry.
defaultBootstrap_InitialComponentContextback to summary
public static com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext()

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 com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext(String ini_file, Hashtable<String, String> bootstrap_parameters)

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 com.sun.star.uno.XComponentContext defaultBootstrap_InitialComponentContext(String ini_file, Map<String, String> bootstrap_parameters)

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 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()] );
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 com.sun.star.loader.CannotActivateFactoryException, com.sun.star.container.ElementExistException
pipeback to summary
private static void pipe(final InputStream in, final PrintStream out, final String prefix)