From b9337e22ce1dbf2eba0e8c8db294ae99f4111f91 Mon Sep 17 00:00:00 2001
From: Bjoern Michaelsen This library can operate in two modes, application mode and direct mode.Application Mode
- In application mode the Java related settings are stored in files.
- There are currently three files which need to be accessed. They are determined
- by bootstrap parameters:
The values for these parameters must be file URLs and include the file name, for
- example:
- file:///d:/MyApp/javavendors.xml
- All files are XML files and must have the extension .xml.
- Modifying the shared settings is currently not supported by the framework. To provide - Java settings for all users one can run OOo and change the settings in the - options dialog. These settings are made persistent in the UNO_JAVA_JFW_USER_DATA. - The file can then be copied into the base installation. - Other users will use automatically these data but can override the settings in - the options dialog. This mechanism may change in the future. -
-If shared Java settings are not supported by an application then it is not
- necessary to specify the bootstrap parameter UNO_JAVA_JFW_SHARED_DATA
.
-
Setting the class path used by a Java VM should not be necesarry. The locations - of Jar files should be knows by a class loader. If a jar file depends on another - jar file then it can be referenced in the manifest file of the first jar. However, - a user may add jars to the class path by using this API. If it becomes necessary - to add files to the class path which is to be used by all users then one can use - the bootrap parameter UNO_JAVA_JFW_CLASSPATH_URLS. The value contains of file URLs - which must be separated by spaces.
- - -The direct mode is intended for a scenario where no configuration files - are available and a Java VM shall be run. That is, - the files containing the user and shared settings are not specified by the - bootstrap parameters UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_USER_DATA. - For example, tools, such as regcomp, may use this framework in a build - environment. Then one would want to use settings which have been specified - by the build environment. The framework would automatically use the - current settings when they change in the environment. -
- -Here are examples how regcomp could be invoked using bootstrap parameters: -
-- regcomp -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2 - -env:"UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar" - -register .... -
-If UNO_JAVA_JFW_VENDOR_SETTINGS is not set then a plugin library must be specified. For example:
-- regcomp -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2 - -env:"UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar" - -env:UNO_JAVA_JFW_PLUGIN=file:\\solver\\bin\\libsunjavaplugin.dll -register .... -
-Additionall parameters for the Java VM can be provided. For every parameter
- a seperate bootstrap parameter must be specified. The names are
- UNO_JAVA_JFW_PARAMETER_X
, where X is 1,2, .. n. For example:
- regcomp -env:UNO_JAVA_JFW_PARAMETER_1=-Xdebug - -env:UNO_JAVA_JFW_PARAMETER_2=-Xrunjdwp:transport=dt_socket,server=y,address=8100 - -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2 - -env:"UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar" - -register ....
-- Here is a complete list of the bootstrap parameter for the direct mode: -
-A note about bootstrap parameters. The implementation of the bootstrap - parameter mechanism interprets the characters '\', '$', '{', '}' as - escape characters. Thats why the Windows path contain double back-slashes. - One should also take into account that a console may have also special - escape characters.
- -- The default mode is application mode. If at least one bootstrap parameter - for the direct mode is provided then direct mode is used.
- -- All settings made by this API are done for the current user if not - mentioned differently.
- -- The flag is used with JavaInfo::nFeatures.
- */ -#define JFW_FEATURE_ACCESSBRIDGE 0x1l -/** indicates that there must be an environment set up before the Java process - runs. -Therefore, when a Java is selected in OO then the office must be - restarted, so that the changes can take effect.
- */ -#define JFW_REQUIRE_NEEDRESTART 0x1l - -/** error codes which are returned by functions of this API. - */ -typedef enum _javaFrameworkError -{ - JFW_E_NONE, - JFW_E_ERROR, - JFW_E_INVALID_ARG, - JFW_E_NO_SELECT, - JFW_E_INVALID_SETTINGS, - JFW_E_NEED_RESTART, - JFW_E_RUNNING_JVM, - JFW_E_JAVA_DISABLED, - JFW_E_NO_PLUGIN, - JFW_E_NOT_RECOGNIZED, - JFW_E_FAILED_VERSION, - JFW_E_NO_JAVA_FOUND, - JFW_E_VM_CREATION_FAILED, - JFW_E_CONFIGURATION, - JFW_E_DIRECT_MODE -} javaFrameworkError; - -/** an instance of this struct represents an installation of a Java - Runtime Environment (JRE). - -
- Instances of this struct are created by the plug-in libraries which are used by
- this framework (jvmfwk/vendorplugin.h). The memory of the instances is created
- by rtl_allocateMemory
(rtl/alloc.h). Therefore, the memory must
- be freed by rtl_freeMemory
. Also the contained members must be
- freed particularly.
- For convenience this API provides the function jfw_freeJavaInfo
- which frees the objects properly.
string must be the same as the one obtained from the
- Java system property java.vendor
.
-
The version string must adhere to the rules
- about how a version string has to be formed. These rules may
- be vendor-dependent. Essentially the strings must syntactically
- equal the Java system property java.version
.
-
For example, JFW_FEATURE_ACCESSBRIDGE
indicates that
- assistive technology tools are supported.
For example, it may be necessary to prepare the environment before
- the runtime is created. That could mean, setting the
- LD_LIBRARY_PATH
- when nRequirements
contains the flag
- JFW_REQUIRE_NEEDRESTART
There is no rule about the format and content of the sequence's - values. The plug-in libraries can put all data, necessary for - starting the java runtime into this sequence.
- */ - sal_Sequence * arVendorData; -}; - -typedef struct _JavaInfo JavaInfo; - -/** frees the memory of aJavaInfo
object.
- @param pInfo
- The object which is to be freed. It can be NULL;
- */
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo);
-
-
-/** compares two JavaInfo
objects for equality.
-
- Two JavaInfo
objects are said to be equal if the contained
- members of the first JavaInfo
are equal to their counterparts
- in the second JavaInfo
object. The equality of the
- rtl_uString
members is determined
- by the respective comparison function (see
- OUString::equals
).
- Similiarly the equality of the sal_Sequence
is
- also determined by a comparison
- function (see rtl::ByteSequence::operator ==
).
- Both argument pointers must be valid.
- @param pInfoA - the first argument. - @param pInfoB - the second argument which is compared with the first. - @return - sal_True - both object represent the same JRE. - sal_False - the objects represend different JREs - */ -JVMFWK_DLLPUBLIC sal_Bool SAL_CALL jfw_areEqualJavaInfo( - JavaInfo const * pInfoA,JavaInfo const * pInfoB); - -/** determines if a Java Virtual Machine is already running. - -As long as the office and the JREs only support one - Virtual Machine per process the Java settings, particulary the - selected Java, are not effective immediately after changing when - a VM has already been running. That is, if a JRE A was used to start - a VM and then a JRE B is selected, then JRE B will only be used - after a restart of the office.
-- By determining if a VM is running, the user can be presented a message, - that the changed setting may not be effective immediately.
- - @param bRunning - [out] sal_True - a VM is running.bRunning
was NULL.
-*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning);
-
-/** detects a suitable JRE and configures the framework to use it.
-
- Which JREs can be used is determined by the file javavendors.xml, - which contains version requirements, as well as information about available - plug-in libraries. Only these libraries are responsible for locating JRE - installations.
-
- JREs can be provided by different vendors. In order to find the JREs of
- a certain vendor a plug-in library must be provided. There must be only one
- library for one vendor. The names of locations of those libraries have to
- be put into the javavendors.xml file.
- The function uses the plug-in libraries to obtain information about JRE
- installation and checks if they there is one among them that supports
- a set of features (currently only accessibilty is possible). If none was
- found then it also uses a list of paths, which have been registered
- by jfw_addJRELocation
or jfw_setJRELocations
- to find JREs. Found JREs are examined in the same way.
- A JRE installation is only selected if it meets the version requirements.
- Information about the selected JRE are made persistent so that
- subsequent calls to jfw_getSelectedJRE
returns this
- information.
- While determining a proper JRE this function takes into account if a
- user requires support for assistive technology tools. If user
- need that support they have to set up their system accordingly. When support
- for assistive technology is required, then the lists of
- JavaInfo
objects,
- which are provided by the getJavaInfo
functions of the plug-ins, are
- examined for a suitable JRE. That is, the JavaInfo
objects
- from the list
- obtained from the first plug-in, are examined. If no JavaInfo
- object has the flag
- JFW_FEATURE_ACCESSBRIDGE
in the member nFeatures
- then the
- next plug-in is used to obtain a list of JavaInfo
objects.
- This goes on until a JavaInfo
object was found which
- represents a suitable JRE. Or neither plug-in provided such a
- JavaInfo
object. In that case the first
- JavaInfo
object from the first plug-in is used to determine
- the JRE which is to be used.
- If there is no need for the support of assistive technology tools then
- the first JavaInfo
object from the list obtained by the
- first plug-in is used. If this plug-in does not find any JREs then the
- next plug-in is used, and so on.
JavaInfo
pointer, representing the selected JRE.
- The caller has to free it by calling jfw_freeJavaInfo. The
- JavaInfo
is for informational purposes only. It is not
- necessary to call jfw_setSelectedJRE
afterwards.
- ppInfo
can be NULL. If *ppInfo
is not null, then it is
- overwritten, without attempting to free *ppInfo
.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_ERROR an error occurred.
- JFW_E_NO_PLUGIN a plug-in library could not be found.
- JFW_E_NO_JAVA_FOUND no JRE was found that meets the requirements.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo);
-
-/** provides information about all availabe JRE installations.
-
- The function determines dynamically what JREs are available. It uses
- the plug-in libraries to provide lists of available JavaInfo
- objects where each object represents a JRE (see vendorplugin.h,
- getAllJavaInfos). It also uses a list of paths, which have been registered
- by jfw_addJRELocation
or jfw_setJRELocations
.
- It is checked if the path still contains a valid JRE and if so the respective
- JavaInfo
object will be appended to the array unless there is
- already an equal object.
-
- @param parInfo
- [out] on returns it contains a pointer to an array of JavaInfo
- pointers.
- The caller must free the array with rtl_freeMemory
and each
- element of the array must be freed with jfw_freeJavaInfo
.
- @param pSize
- [out] on return contains the size of array returned in parInfo
.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALID_ARG at least on of the parameters was NULL
- JFW_E_ERROR an error occurred.
- JFW_E_NO_PLUGIN a plug-in library could not be found.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
-*/
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAllJREs(
- JavaInfo ***parInfo, sal_Int32 *pSize);
-
-/** determines if a path points to a Java installation.
-
- If the path belongs to a JRE installation then it returns the
- respective JavaInfo
object. The function uses the
- getJavaInfoByPath
function of the plug-ins to obtain the
- JavaInfo
object. Only if the JRE found at the specified location
- meets the version requirements as specified in the javavendors.xml file a
- JavaInfo
object is returned.
-
- The functions only checks if a JRE exists but does not modify any settings.
- To make the found JRE the "selected JRE" one has
- to call jfw_setSelectedJRE
.
-
- @param pPath
- [in] a file URL to a directory.
- @param pInfo
- [out] the JavaInfo
object which represents a JRE found at the
- location specified by pPath
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALID_ARG at least on of the parameters was NULL
- JFW_E_ERROR an error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_NO_PLUGIN a plug-in library could not be found.
- JFW_E_NOT_RECOGNIZED neither plug-in library could detect a JRE.
- JFW_E_FAILED_VERSION a JRE was detected but if failed the version
- requirements as determined by the javavendors.xml
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
- rtl_uString *pPath, JavaInfo **ppInfo);
-
-
-/** starts a Java Virtual Machine (JVM).
-
- The function uses the current settings to start a JVM. The actual
- start-up code, however, is provided by the plug-in libraries. The setting
- of the "selected Java" contains the information as to what vendor
- the respective JRE comes from. In the javavendors.xml there is a mapping of
- vendor names to the respective plug-in libraries.
-
- The function ultimately calls startJavaVirtualMachine
from
- the plug-in library.
-
- The arOptions
- argument contains start arguments which are passed in JavaVMOption structures
- to the VM during its creation. These
- could be things, such as language settings, proxy settings or any other
- properties which shall be obtainable by
- java.lang.System.getProperties
. One can also pass options which
- have a certain meaning to the runtime behaviour such as -ea or -X... However,
- one must be sure that these options can be interpreted by the VM.
- The class path cannot be set this way. The class path is internally composed by
- the paths to archives in a certain directory, which is preconfigured in
- the internal data store and the respective user setting (see
- jfw_setUserClassPath
.
-
- If a JRE was selected at runtime which was different from the previous
- setting and that JRE needs a prepared environment, for example an adapted
- LD_LIBRARY_PATH
environment variable, then the VM will not be
- created and JFW_E_NEED_RESTART error is returned. If a VM is already running
- then a JFW_E_RUNNING_JVM is returned.
-
- @param pInfo
- [in] optional pointer to a specific JRE; must be caller-freed if not NULL
- @param arOptions
- [in] the array containing additional start arguments or NULL.
- @param nSize
- [in] the size of the array arOptions
.
- @param ppVM
- [out] the JavaVM
pointer.
- @param ppEnv
- [out] the JNIenv
pointer.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALID_ARG ppVM
, ppEnv
are NULL or
- arOptions
was NULL but nSize
was greater 0.
- JFW_E_ERROR an error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_NO_PLUGIN the plug-in library responsible for creating the VM
- could not be found.
- JFW_E_JAVA_DISABLED the use of Java is currently disabled.
- JFW_E_NO_SELECT there is no JRE selected yet.
- JFW_E_RUNNIN_JVM there is already a VM running.
- JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no
- JRE has been selected afterwards.
- JFW_E_NEED_RESTART in the current process a different JRE has been selected
- which needs a prepared environment, which has to be done before the office
- process. Therefore the new JRE may not be used until the office was restarted.
- JFW_E_NEED_RESTART is also returned when Java was disabled at the beginning and
- then the user enabled it. If then the selected JRE has the requirement
- JFW_REQUIRE_NEEDRESTART then this error is returned.
- JFW_E_VM_CREATION_FAILED the creation of the JVM failed. The creation is performed
- by a plug-in library and not by this API.
- JFW_E_FAILED_VERSION the "Default Mode" is active. The JRE determined by
- JAVA_HOME
does not meet the version requirements.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_startVM(
- JavaInfo const * pInfo, JavaVMOption * arOptions, sal_Int32 nSize,
- JavaVM ** ppVM, JNIEnv ** ppEnv);
-
-/** determines the JRE that is to be used.
-
- When calling jfw_startVM
then a VM is startet from
- the JRE that is determined by this function.
- It is not verified if the JRE represented by the JavaInfo
- argument meets the requirements as specified by the javavendors.xml file.
- However, usually one obtains the JavaInfo
object from the
- functions jfw_findAllJREs
or jfw_getJavaInfoByPath
,
- which do verify the JREs and pass out only JavaInfo
objects
- which comply with the version requirements.
-
- If pInfo
is NULL then the meaning is that no JRE will be
- selected. jfw_startVM
will then return
- JFW_E_NO_SELECT
.
-
- @param pInfo
- [in] pointer to JavaInfo
structure, containing data about a
- JRE. The caller must still free pInfo
.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo);
-
-
-/** provides information about the JRE that is to be used.
-
- If no JRE is currently selected then ppInfo
will contain
- NULL on return.
- If the value of the element in the javavendors.xml file was
- changed since the time when the last Java was selected then this
- function returns JFW_E_INVALID_SETTINGS
. This could happen during
- a product patch. Then new version requirements may be introduced, so that
- the currently selected JRE may not meet these requirements anymore.
-
- In direct mode the function returns information about a JRE that was
- set by the bootstrap parameter UNO_JAVA_JFW_JREHOME.
-
- @param ppInfo
- [out] on return it contains a pointer to a JavaInfo
object
- that represents the currently selected JRE. When *ppInfo
is not
- NULL then the function overwrites the pointer. It is not attempted to free
- the pointer.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG ppInfo
is a NULL.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no
- JRE has been selected afterwards.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo);
-
-
-/** determines if Java can be used.
-
- If bEnabled
is sal_False
then a call
- to jfw_startVM will result in an error with the errorcode
- JFW_E_JAVA_DISABLED
-
- @param bEnabled
- [in] use of Java enabled/disabled.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled);
-
-/** provides the information if Java can be used.
-
- That is if the user enabled or disabled the use of Java.
-
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG pbEnabled is NULL
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled);
-
-/** determines parameters which are passed to VM during its creation.
-
- The strings must be exactly as they are passed on the command line.
- For example, one could pass
- -Xdebug
- -Xrunjdw:transport=dt_socket,server=y,address=8000
- in order to enable debugging support.
-
-
- @param arParameters
- [in] contains the arguments. It can be NULL if nSize is 0.
- @param nSize
- [i] the size of arArgs
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG arArgs is NULL and nSize is not 0
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setVMParameters(
- rtl_uString ** arArgs, sal_Int32 nSize);
-
-/** obtains the currently used start parameters.
-
- The caller needs to free the returned array with
- rtl_freeMemory
. The contained strings must be released with
- rtl_uString_release
.
-
-
- @param parParameters
- [out] on returns contains a pointer to the array of the start arguments.
- If *parParameters is not NULL then the value is overwritten.
- @param pSize
- [out] on return contains the size of array returned in
- parParameters
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG parParameters or pSize are NULL
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getVMParameters(
- rtl_uString *** parParameters,
- sal_Int32 * pSize);
-
-/** sets the user class path.
-
- When the VM is started then it is passed the class path. The
- class path also contains the user class path set by this function.
- The paths contained in pCP
must be separated with a
- system dependent path separator.
-
- @param pCP
- [in] the user class path.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG pCP is NULL.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCP);
-/** provides the value of the current user class path.
-
- The function returns an empty string if no user class path is set.
-
-
- @param ppCP
- [out] contains the user class path on return. If *ppCP
was
- not NULL then the value is overwritten. No attempt at freeing that string
- is made.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG ppCP is NULL.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP);
-
-/** saves the location of a JRE.
-
- When jfw_findAllJREs
is called then the paths added by this
- function are evaluated. If the location still represents a
- JRE then a JavaInfo
object is created which is returned along
- with all other JavaInfo
objects by
- jfw_findAllJREs
. If the location
- cannot be recognized then the location string is ignored.
-
- A validation if sLocation
points to a JRE is not
- performed. To do that one has to use jfw_getJavaInfoByPath
.
-
-
- Adding a path that is already stored causes no error.
-
- @param sLocation
- [in] file URL to a directory which contains a JRE.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG sLocation is NULL.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- @see jfw_setJRELocations
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation);
-
-/** saves the locations of a number of JREs.
-
-
- The function does not verify if the paths points to JRE. However,
- it makes sure that every path is unique. That is, if the array
- contains strings which are the same then only one is stored.
-
- If arLocations
is NULL or it has the length null (nSize = 0)
- then all previously stored paths are deleted. Otherwise,
- the old values are overwritten.
-
- @param arLocations
- [in] array of paths to locations of JREs.
-
- @param nSize
- [in] the size of the array arLocations
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG arLocation is NULL and nSize is not null.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- @see jfw_addJRELocations
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setJRELocations(
- rtl_uString ** arLocations, sal_Int32 nSize);
-/** obtains an array containing paths to JRE installations.
-
-
- It is not guaranteed that the returned paths represent
- a valid JRE. One can use jfw_getJavaInfoByPath
to check this.
-
-
- @param parLocations
- [out] on return it contains the array of paths.
- @param pSize
- [out] on return it contains the size of the array parLocations
.
-
- @return
- JFW_E_NONE function ran successfully.
- JFW_E_INVALIDARG parLocation is NULL or pSize is NULL.
- JFW_E_ERROR An error occurred.
- JFW_E_CONFIGURATION mode was not properly set or their prerequisites
- were not met.
- JFW_E_DIRECT_MODE the function cannot be used in this mode.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJRELocations(
- rtl_uString *** parLocations, sal_Int32 * pSize);
-
-
-/** checks if the installation of the jre still exists.
-
- This function checks if the JRE described by pInfo still
- exists. The check must be very quick because it is called by javaldx
- (Linux, Solaris) at start up.
-
- @param pInfo
- [in] the JavaInfo object with information about the JRE.
- @param pp_exist
- [out] the parameter is set to either sal_True or sal_False. The value is
- only valid if the function returns JFW_E_NONE.
-
- @return
- JFW_E_NONE the function ran successfully.
- JFW_E_ERROR an error occurred during execution.
- JFW_E_INVALID_ARG pInfo contains invalid data
- JFW_E_NO_PLUGIN a plug-in library could not be found.
- */
-JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
-
-
-/** locks this API so that it cannot be used by other threads.
-
- If a different thread called this function before then the
- current call is blocked until the other thread has called
- jfw_unlock()
. The function should be called if one
- needs an exact snapshot of the current settings. Then the settings
- are retrieved one by one without risk that the settings may be changed
- by a different thread. Similiary if one needs to make settings which
- should become effective at the same time then jfw_lock
- should be called. That is, jfw_startVM
which uses the
- settings cannot be called before all settings have be made.
-
- The only functions which are not effected by jfw_lock
are
- jfw_freeJavaInfo
and jfw_areEqualJavaInfo
.
- */
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_lock();
-
-/** unlocks this API.
-
-
This function is called after jfw_lock
. It allows other
- threads to use this API concurrently.
-*/
-JVMFWK_DLLPUBLIC void SAL_CALL jfw_unlock();
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/inc/jvmfwk/jvmfwkdllapi.h b/jvmfwk/inc/jvmfwk/jvmfwkdllapi.h
deleted file mode 100644
index 52c8273b5954..000000000000
--- a/jvmfwk/inc/jvmfwk/jvmfwkdllapi.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_JVMFWK_JVMFWKDLLAPI_H
-#define INCLUDED_JVMFWK_JVMFWKDLLAPI_H
-
-#include
-
-#if defined JVMFWK_DLLIMPLEMENTATION
-# define JVMFWK_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-# define JVMFWK_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-#define JVMFWK_DLLPRIVATE SAL_DLLPRIVATE
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/inc/jvmfwk/jvmfwkplugindllapi.h b/jvmfwk/inc/jvmfwk/jvmfwkplugindllapi.h
deleted file mode 100644
index d96016e261bb..000000000000
--- a/jvmfwk/inc/jvmfwk/jvmfwkplugindllapi.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_JVMFWK_JVMFWKPLUGINDLLAPI_H
-#define INCLUDED_JVMFWK_JVMFWKPLUGINDLLAPI_H
-
-#include
-
-#if defined JVMFWK_PLUGIN_DLLIMPLEMENTATION
-# define JVMFWK_PLUGIN_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-# define JVMFWK_PLUGIN_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-#define JVMFWK_PLUGIN_DLLPRIVATE SAL_DLLPRIVATE
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/inc/jvmfwk/vendorplugin.h b/jvmfwk/inc/jvmfwk/vendorplugin.h
deleted file mode 100644
index 5ca5e10009ba..000000000000
--- a/jvmfwk/inc/jvmfwk/vendorplugin.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-/** @HTML */
-#ifndef INCLUDED_JVMFWK_VENDORPLUGIN_H
-#define INCLUDED_JVMFWK_VENDORPLUGIN_H
-
-#include "jvmfwkplugindllapi.h"
-#include "jvmfwk/framework.h"
-#include "rtl/ustring.h"
-#include "jni.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- @file
-
- This API shall be implemented if one wants to support a Java Runtime
- Environment (JRE) of a particular vendor. Because there is currently no
- specification which rules the structure and location of JRE installations
- and the format of version strings it is not possible to supply a general
- implementation for all possible vendors. If an application determines exactly
- what version a JRE must have then it relies on certain features and bug
- fixes of that version. Because a version 1.4.2_1 from vendor X may contain
- different fixes as the same version from vendor Y it is important to see
- version an vendor as one entity. One without the other does not guarantee
- the existence of a particular set of features or bug fixes. An implementation
- of this API may support multiple vendors.
-
- Libraries which implement this interface will be dynamically loaded and
- unloaded by the java framework (jvmfwk/framework.h). Therefore they must not
- keep global variables.
-
- */
-
-typedef enum
-{
- JFW_PLUGIN_E_NONE,
- JFW_PLUGIN_E_ERROR,
- JFW_PLUGIN_E_INVALID_ARG,
- JFW_PLUGIN_E_WRONG_VERSION_FORMAT,
- JFW_PLUGIN_E_FAILED_VERSION,
- JFW_PLUGIN_E_NO_JRE,
- JFW_PLUGIN_E_WRONG_VENDOR,
- JFW_PLUGIN_E_VM_CREATION_FAILED
-} javaPluginError;
-
-
-
-/** obtains information about installations of Java Runtime Environments (JREs).
-
- The function gathers information about available JREs which have the same
- vendor as determined by the sVendor
parameter. Only information
- about those JREs which match the version requirements are returned. These
- requirements are specified by the parameters sMinVersion
,
- sMaxVersion
and arExcludeList
.
-
-
- The JavaInfo structures returned in parJavaInfo
should be ordered
- according to their version. The one, representing a JRE with the highest
- version should be the first in the array.
-
- The function allocates memory for an array and all the JavaInfo objects returned
- in parJavaInfo
. The caller must free each JavaInfo object by calling
- jfw_freeJavaInfo
(#include "jvmfwk/framework.h"). The array is to be
- freed by rtl_freeMemory.
- In case an error occurred parJavaInfo
need not be freed.
-
- @param sVendor
- [in] only JREs from this vendor are examined. This parameter always contains
- a vendor string. That is, the string it is not empty.
- @param sMinVersion
- [in] represents the minimum version of a JRE. The string can be empty but
- a null pointer is not allowed.
- @param sMaxVersion
- [in] represents the maximum version of a JRE. The string can be empty but
- a null pointer is not allowed.
- @param arExcludeList
- [in] contains a list of "bad" versions. JREs which have one of these
- versions must not be returned by this function. It can be NULL.
- @param nSizeExcludeList
- [in] the number of version strings contained in arExcludeList
.
- @param parJavaInfo
- [out] if the function runs successfully then parJavaInfo
contains
- on return an array of pointers to JavaInfo
objects.
- @param nSizeJavaInfo
- [out] the number of JavaInfo
pointers contained in
- parJavaInfo
.
-
- @return
- JFW_PLUGIN_E_NONE the function ran successfully.
- JFW_PLUGIN_E_ERROR an error occurred during execution.
- JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
- nSizeExcludeList
is greater null but arExcludeList
- is NULL or NULL pointer were passed for at least on of the strings.
- JFW_PLUGIN_E_WRONG_VERSION_FORMAT the version strings in
- sMinVersion,sMaxVersion,arExcludeList
are not recognized as valid
- version strings.
- */
-JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_getAllJavaInfos(
- rtl_uString *sVendor,
- rtl_uString *sMinVersion,
- rtl_uString *sMaxVersion,
- rtl_uString * * arExcludeList,
- sal_Int32 nSizeExcludeList,
- JavaInfo*** parJavaInfo,
- sal_Int32 *nSizeJavaInfo);
-
-/** obtains information for a JRE at a given location.
-
- If the given location belongs to a JRE whoose vendor matches the
- sVendor argument and the JRE has a version which meets the requirements as
- specified by sMinVersion, sMaxVersion, arExcludeList
then
- this function shall return a JavaInfo object for this JRE if this implementation
- supports this vendor.
-
- @param sLocation
- [in] a file URL to the directory of the JRE.
- @param sVendor
- [in] a name of a vendor. This parameter always contains
- a vendor string. That is, the string it is not empty.
- @param sMinVersion
- [in] represents the minimum version of a JRE.
- @param sMaxVersion
- [in] represents the maximum version of a JRE.
- @param arExcludeList
- [in] contains a list of "bad" versions. JREs which have one of these
- versions must not be returned by this function. It can be NULL.
- @param nSizeExcludeList
- [in] the number of version strings contained in arExcludeList
.
- @param ppInfo
- [out] if the function runs successfully then ppInfo
contains
- on return a pointer to a JavaInfo
object.
-
- @return
- JFW_PLUGIN_E_NONE the function ran successfully.
- JFW_PLUGIN_E_ERROR an error occurred during execution.
- JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
- nSizeExcludeList
is greater null but arExcludeList
- is NULL, NULL pointer were passed for at least on of the strings, sLocation
- is an empty string.
- JFW_PLUGIN_E_WRONG_VERSION_FORMAT the version strings in
- sMinVersion,sMaxVersion,arExcludeList
are not recognized as valid
- version strings.
- JFW_PLUGIN_E_FAILED_VERSION there is a JRE at the given location but it does not
- meet the version requirements.
- JFW_PLUGIN_E_NO_JRE no JRE could be detected at the given location. However, that
- does not mean necessarily that there is no JRE. There could be a JRE but it has
- a vendor which is not supported by this API implementation.
- */
-JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_getJavaInfoByPath(
- rtl_uString *sLocation,
- rtl_uString *sVendor,
- rtl_uString *sMinVersion,
- rtl_uString *sMaxVersion,
- rtl_uString * *arExcludeList,
- sal_Int32 nSizeExcludeList,
- JavaInfo ** ppInfo);
-
-/** starts a Java Virtual Machine.
-
- The caller should provide all essential JavaVMOptions, such as the
- class path (-Djava.class.path=xxx). It is assumed that the caller
- knows what JRE is used. Hence the implementation does not need to check
- the options for validity. If a user configured the application to
- use specific options, such as -X..., then it is in his responsibility to
- ensure that the application works properly. The function may add or modify
- properties. For example, it may add to the class path property.
-
- The function must ensure, that the VM does not abort the process
- during instantiation.
-
- The function receives a JavaInfo
object that was created
- by the functions jfw_plugin_getJavaInfoByPath
or
- jfw_plugin_getAllJavaInfos
from the same library. This can be
- guaranteed if an application uses exactly one library for one vendor.
- Therefore the functions which create the JavaInfo
can store all
- necessary information which are needed for starting the VM into that
- structure.
-
- @param pInfo
- [in] the JavaInfo object with information about the JRE.
- @param arOptions
- [in] the options which are passed into the JNI_CreateJavaVM function.
- Can be NULL.
- @param nSizeOptions
- [in] the number of elements in arOptions
.
- @param ppVM
- [out] the JavaVM pointer of the created VM.
- @param ppEnv
- [out] the JNIEnv pointer of the created VM.
-
- @return
- JFW_PLUGIN_E_NONE the function ran successfully.
- JFW_PLUGIN_E_ERROR an error occurred during execution.
- JFW_PLUGIN_E_WRONG_VENDOR the JavaInfo
object was not created
- in by this library and the VM cannot be started.
- JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
- pInfo
or , ppVM
or ppEnv
are NULL.
-
- JFW_PLUGIN_E_VM_CREATION_FAILED a VM could not be created. The error was caused
- by the JRE.
- */
-JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_startJavaVirtualMachine(
- const JavaInfo *pInfo,
- const JavaVMOption *arOptions,
- sal_Int32 nSizeOptions,
- JavaVM ** ppVM,
- JNIEnv ** ppEnv);
-
-
-
-/** checks if the installation of the jre still exists.
-
- This function checks if the JRE described by pInfo still
- exists. The check must be very quick because it is called by javaldx
- (Linux, Solaris) at start up.
-
- @param pInfo
- [in] the JavaInfo object with information about the JRE.
- @param pp_exist
- [out] the parameter is set to either sal_True or sal_False. The value is
- only valid if the function returns JFW_E_NONE.
-
- @return
- JFW_PLUGIN_E_NONE the function ran successfully.
- JFW_PLUGIN_E_ERROR an error occurred during execution.
- JFW_PLUGIN_E_INVALID_ARG pInfo contains invalid data
- */
-JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
cgit