LibreOffice Module jvmfwk (master) 1
include/jvmfwk/framework.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22#ifndef INCLUDED_JVMFWK_FRAMEWORK_HXX
23#define INCLUDED_JVMFWK_FRAMEWORK_HXX
24
25#include <sal/config.h>
26
27#include <memory>
28#include <vector>
29
31#include <rtl/byteseq.hxx>
32#include <rtl/ustring.hxx>
33#if defined __clang__
34#pragma clang diagnostic push
35#pragma clang diagnostic ignored "-Wunknown-attributes"
36#endif
37#include <jni.h>
38#if defined __clang__
39#pragma clang diagnostic pop
40#endif
41
174#define JFW_REQUIRE_NEEDRESTART 0x1l
175
179{
194
203{
210 OUString sVendor;
213 OUString sLocation;
222 OUString sVersion;
231 sal_uInt64 nRequirements;
238 rtl::ByteSequence arVendorData;
239};
240
261JVMFWK_DLLPUBLIC bool jfw_areEqualJavaInfo(JavaInfo const* pInfoA, JavaInfo const* pInfoB);
262
279
323JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo>* pInfo);
324
346jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>>* parInfo);
347
357JVMFWK_DLLPUBLIC std::vector<OUString> jfw_convertUserPathList(OUString const& sUserPath);
358
388 std::unique_ptr<JavaInfo>* ppInfo);
389
451 std::vector<OUString> const& arOptions,
452 JavaVM** ppVM, JNIEnv** ppEnv);
453
481
507JVMFWK_DLLPUBLIC javaFrameworkError jfw_getSelectedJRE(std::unique_ptr<JavaInfo>* ppInfo);
508
526
540
560JVMFWK_DLLPUBLIC javaFrameworkError jfw_setVMParameters(std::vector<OUString> const& arArgs);
561
574JVMFWK_DLLPUBLIC javaFrameworkError jfw_getVMParameters(std::vector<OUString>* parParameters);
575
610
637
655
672
679
680#endif
681
682/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
JVMFWK_DLLPUBLIC javaFrameworkError jfw_getSelectedJRE(std::unique_ptr< JavaInfo > *ppInfo)
provides information about the JRE that is to be used.
Definition: framework.cxx:497
JVMFWK_DLLPUBLIC bool jfw_isVMRunning()
determines if a Java Virtual Machine is already running.
Definition: framework.cxx:545
JVMFWK_DLLPUBLIC void jfw_unlock()
unlocks this API.
Definition: framework.cxx:800
JVMFWK_DLLPUBLIC javaFrameworkError jfw_setEnabled(bool bEnabled)
determines if Java can be used.
Definition: framework.cxx:618
JVMFWK_DLLPUBLIC javaFrameworkError jfw_getJavaInfoByPath(OUString const &pPath, std::unique_ptr< JavaInfo > *ppInfo)
determines if a path points to a Java installation.
Definition: framework.cxx:551
JVMFWK_DLLPUBLIC javaFrameworkError jfw_getEnabled(bool *pbEnabled)
provides the information if Java can be used.
Definition: framework.cxx:651
JVMFWK_DLLPUBLIC javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, bool *exist)
checks if the installation of the jre still exists.
Definition: framework.cxx:776
JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr< JavaInfo > *pInfo)
detects a suitable JRE and configures the framework to use it.
Definition: framework.cxx:360
JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAllJREs(std::vector< std::unique_ptr< JavaInfo > > *parInfo)
provides information about all available JRE installations.
Definition: framework.cxx:59
JVMFWK_DLLPUBLIC javaFrameworkError jfw_setUserClassPath(OUString const &pCP)
sets the user class path.
Definition: framework.cxx:713
JVMFWK_DLLPUBLIC bool jfw_areEqualJavaInfo(JavaInfo const *pInfoA, JavaInfo const *pInfoB)
compares two JavaInfo objects for equality.
Definition: framework.cxx:480
JVMFWK_DLLPUBLIC std::vector< OUString > jfw_convertUserPathList(OUString const &sUserPath)
Convert colon-separated userClassPath which might contain bootstrap variables (which also might conta...
Definition: framework.cxx:136
JVMFWK_DLLPUBLIC void jfw_lock()
locks this API so that it cannot be used by other threads.
Definition: framework.cxx:795
JVMFWK_DLLPUBLIC javaFrameworkError jfw_addJRELocation(OUString const &sLocation)
saves the location of a JRE.
Definition: framework.cxx:753
JVMFWK_DLLPUBLIC javaFrameworkError jfw_setVMParameters(std::vector< OUString > const &arArgs)
determines parameters which are passed to VM during its creation.
Definition: framework.cxx:672
javaFrameworkError
error codes which are returned by functions of this API.
@ JFW_E_INVALID_SETTINGS
@ JFW_E_VM_CREATION_FAILED
JVMFWK_DLLPUBLIC javaFrameworkError jfw_startVM(JavaInfo const *pInfo, std::vector< OUString > const &arOptions, JavaVM **ppVM, JNIEnv **ppEnv)
starts a Java Virtual Machine (JVM).
Definition: framework.cxx:170
JVMFWK_DLLPUBLIC javaFrameworkError jfw_getUserClassPath(OUString *ppCP)
provides the value of the current user class path.
Definition: framework.cxx:733
JVMFWK_DLLPUBLIC javaFrameworkError jfw_getVMParameters(std::vector< OUString > *parParameters)
obtains the currently used start parameters.
Definition: framework.cxx:693
JVMFWK_DLLPUBLIC javaFrameworkError jfw_setSelectedJRE(JavaInfo const *pInfo)
determines the JRE that is to be used.
Definition: framework.cxx:588
#define JVMFWK_DLLPUBLIC
an instance of this struct represents an installation of a Java Runtime Environment (JRE).
OUString sVersion
contains the version of this Java distribution.
sal_uInt64 nRequirements
indicates requirements for running the java runtime.
OUString sLocation
contains the file URL to the installation directory.
OUString sVendor
contains the vendor.
rtl::ByteSequence arVendorData
contains data needed for the creation of the java runtime.