elements.hxx (7950f2af) elements.hxx (870c3792)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
20 *************************************************************/
21
22
23#if !defined INCLUDED_JVMFWK_ELEMENTS_HXX
24#define INCLUDED_JVMFWK_ELEMENTS_HXX
25
26#include <vector>
27#include "jvmfwk/framework.h"
28#include "fwkutil.hxx"
29#include "rtl/ustring.hxx"
30#include "rtl/byteseq.hxx"

--- 58 unchanged lines hidden (view full) ---

89 sal_uInt64 nRequirements;
90 ::rtl::ByteSequence arVendorData;
91
92 /** reads the node /java/javaInfo.
93 If javaInfo@xsi:nil = true then member bNil is set to true
94 an no further elements are read.
95 */
96 void loadFromNode(xmlDoc * pDoc,xmlNode * pJavaInfo);
22#if !defined INCLUDED_JVMFWK_ELEMENTS_HXX
23#define INCLUDED_JVMFWK_ELEMENTS_HXX
24
25#include <vector>
26#include "jvmfwk/framework.h"
27#include "fwkutil.hxx"
28#include "rtl/ustring.hxx"
29#include "rtl/byteseq.hxx"

--- 58 unchanged lines hidden (view full) ---

88 sal_uInt64 nRequirements;
89 ::rtl::ByteSequence arVendorData;
90
91 /** reads the node /java/javaInfo.
92 If javaInfo@xsi:nil = true then member bNil is set to true
93 an no further elements are read.
94 */
95 void loadFromNode(xmlDoc * pDoc,xmlNode * pJavaInfo);
97 /** The attribut nil will be set to false. The function gets the value
96 /** The attribute nil will be set to false. The function gets the value
98 javaSettings/updated from the javavendors.xml and writes it to
99 javaInfo@vendorUpdate in javasettings.xml
100 */
101 void writeToNode(xmlDoc * pDoc, xmlNode * pJavaInfo) const;
102
103 /** returns NULL if javaInfo is nil.
104 */
105 JavaInfo * makeJavaInfo() const;

--- 21 unchanged lines hidden (view full) ---

127
128 /** creates settings file and fills it with default values.
129
130 When this function is called then it creates the
131 settings file at the position determined by the bootstrap parameters
132 (UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA,
133 UNO_JAVA_JFW_INSTALL_DATA) and m_layer, unless the file already exists
134 (see createSettingsDocument).
97 javaSettings/updated from the javavendors.xml and writes it to
98 javaInfo@vendorUpdate in javasettings.xml
99 */
100 void writeToNode(xmlDoc * pDoc, xmlNode * pJavaInfo) const;
101
102 /** returns NULL if javaInfo is nil.
103 */
104 JavaInfo * makeJavaInfo() const;

--- 21 unchanged lines hidden (view full) ---

126
127 /** creates settings file and fills it with default values.
128
129 When this function is called then it creates the
130 settings file at the position determined by the bootstrap parameters
131 (UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA,
132 UNO_JAVA_JFW_INSTALL_DATA) and m_layer, unless the file already exists
133 (see createSettingsDocument).
135
134
136 @return
137 JFW_E_CONFIG_READWRITE
138 */
139 void prepareSettingsDocument() const;
140
141 /** helper function for prepareSettingsDocument.
142 */
143 void createSettingsDocument() const;
135 @return
136 JFW_E_CONFIG_READWRITE
137 */
138 void prepareSettingsDocument() const;
139
140 /** helper function for prepareSettingsDocument.
141 */
142 void createSettingsDocument() const;
144
143
145 /** returns the system path to the data file which is to be used. The value
146 depends on the member m_layer and the bootstrap parameters UNO_JAVA_JFW_USER_DATA,
147 UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_INSTALL_DATA which this may be.
148 */
149 ::rtl::OString getSettingsPath() const;
150
151 /** returns the file URL to the data file which is to be used. See getSettingsPath.
144 /** returns the system path to the data file which is to be used. The value
145 depends on the member m_layer and the bootstrap parameters UNO_JAVA_JFW_USER_DATA,
146 UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_INSTALL_DATA which this may be.
147 */
148 ::rtl::OString getSettingsPath() const;
149
150 /** returns the file URL to the data file which is to be used. See getSettingsPath.
152 */
151 */
153 ::rtl::OUString getSettingsURL() const;
154
155 /** Verifies if the respective settings file exist. In case UNO_JAVA_JFW_INSTALL_DATA
156 is used, the age is checked. If the file is too old then we assume that it does not
157 exist and wipe its contents. Then still FILE_DOES_NOT_EXIST is returned.
158 */
159 jfw::FileStatus checkSettingsFileStatus() const;
152 ::rtl::OUString getSettingsURL() const;
153
154 /** Verifies if the respective settings file exist. In case UNO_JAVA_JFW_INSTALL_DATA
155 is used, the age is checked. If the file is too old then we assume that it does not
156 exist and wipe its contents. Then still FILE_DOES_NOT_EXIST is returned.
157 */
158 jfw::FileStatus checkSettingsFileStatus() const;
160
159
161 /** Determines the layer for which the instance the loads and writes the
162 data.
163 */
164 Layer m_layer;
165
166 /** User configurable option. /java/enabled
167 If /java/enabled@xsi:nil == true then the value will be uninitialized
168 after a call to load().

--- 31 unchanged lines hidden (view full) ---

200 the server time is ahead of the client time then checkSettingsFileStatus
201 deleted the settings. So even if javaldx determined a Java
202 (jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then
203 it looked again for a java by calling jfw_findAndSelectJRE, which
204 returned a JFW_E_NONE. But the following jfw_startVM returned again
205 JFW_E_NO_SELECT. So it looped. (see issue i114509)
206
207 NFS server and NFS client should have the same time. It is common
160 /** Determines the layer for which the instance the loads and writes the
161 data.
162 */
163 Layer m_layer;
164
165 /** User configurable option. /java/enabled
166 If /java/enabled@xsi:nil == true then the value will be uninitialized
167 after a call to load().

--- 31 unchanged lines hidden (view full) ---

199 the server time is ahead of the client time then checkSettingsFileStatus
200 deleted the settings. So even if javaldx determined a Java
201 (jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then
202 it looked again for a java by calling jfw_findAndSelectJRE, which
203 returned a JFW_E_NONE. But the following jfw_startVM returned again
204 JFW_E_NO_SELECT. So it looped. (see issue i114509)
205
206 NFS server and NFS client should have the same time. It is common
208 practise to enforce this in networks. We actually should not work
207 practice to enforce this in networks. We actually should not work
209 around a malconfigured network. We must however, make sure that we do
210 not loop. Maybe a better approach is, that:
211 - assume that mtime and system time are reliable
212 - checkSettingsFile uses system time and mtime of the settings file,
213 instset of using getModifiedTime.
214 - allow a small error margin
215 - jfw_startVM must return a JFW_E_EXPIRED_SETTINGS
216 - XJavaVM::startVM should prevent the loop by processing the new return+ value

--- 65 unchanged lines hidden (view full) ---

282 const boost::optional< ::std::vector< ::rtl::OUString> > & getVmParameters() const;
283
284 /** returns the parameters from the element /java/jreLocations/location.
285 */
286 const boost::optional< ::std::vector< ::rtl::OUString> > & getJRELocations() const;
287};
288
289/** merges the settings for shared, user and installation during construction.
208 around a malconfigured network. We must however, make sure that we do
209 not loop. Maybe a better approach is, that:
210 - assume that mtime and system time are reliable
211 - checkSettingsFile uses system time and mtime of the settings file,
212 instset of using getModifiedTime.
213 - allow a small error margin
214 - jfw_startVM must return a JFW_E_EXPIRED_SETTINGS
215 - XJavaVM::startVM should prevent the loop by processing the new return+ value

--- 65 unchanged lines hidden (view full) ---

281 const boost::optional< ::std::vector< ::rtl::OUString> > & getVmParameters() const;
282
283 /** returns the parameters from the element /java/jreLocations/location.
284 */
285 const boost::optional< ::std::vector< ::rtl::OUString> > & getJRELocations() const;
286};
287
288/** merges the settings for shared, user and installation during construction.
290 The class uses a simple merge mechanism for the javasettings.xml files in share and
291 user. The following elements completly overwrite the corresponding elements
289 The class uses a simple merge mechanism for the javasettings.xml files in share and
290 user. The following elements completely overwrite the corresponding elements
292 from share:
293 /java/enabled
294 /java/userClassPath
295 /java/vmParameters
296 /java/jreLocations
297 /java/javaInfo
298
299 In case of an installation, the shared and user settings are completely

--- 17 unchanged lines hidden (view full) ---

317
318 sal_Bool m_bEnabled;
319
320 ::rtl::OUString m_sClassPath;
321
322 ::std::vector< ::rtl::OUString> m_vmParams;
323
324 ::std::vector< ::rtl::OUString> m_JRELocations;
291 from share:
292 /java/enabled
293 /java/userClassPath
294 /java/vmParameters
295 /java/jreLocations
296 /java/javaInfo
297
298 In case of an installation, the shared and user settings are completely

--- 17 unchanged lines hidden (view full) ---

316
317 sal_Bool m_bEnabled;
318
319 ::rtl::OUString m_sClassPath;
320
321 ::std::vector< ::rtl::OUString> m_vmParams;
322
323 ::std::vector< ::rtl::OUString> m_JRELocations;
325
324
326 CNodeJavaInfo m_javaInfo;
327
328public:
329 MergedSettings();
330 virtual ~MergedSettings();
331
332 /** the default is true.
333 */

--- 41 unchanged lines hidden (view full) ---

375 ::std::vector< ::rtl::OUString> vecExcludeVersions;
376 rtl_uString ** arVersions;
377
378public:
379 VersionInfo();
380 ~VersionInfo();
381
382 void addExcludeVersion(const ::rtl::OUString& sVersion);
325 CNodeJavaInfo m_javaInfo;
326
327public:
328 MergedSettings();
329 virtual ~MergedSettings();
330
331 /** the default is true.
332 */

--- 41 unchanged lines hidden (view full) ---

374 ::std::vector< ::rtl::OUString> vecExcludeVersions;
375 rtl_uString ** arVersions;
376
377public:
378 VersionInfo();
379 ~VersionInfo();
380
381 void addExcludeVersion(const ::rtl::OUString& sVersion);
383
382
384 ::rtl::OUString sMinVersion;
385 ::rtl::OUString sMaxVersion;
386
387 /** The caller DOES NOT get ownership of the strings. That is he
388 does not need to release the strings.
389 The array exists as long as this object exists.
390 */
383 ::rtl::OUString sMinVersion;
384 ::rtl::OUString sMaxVersion;
385
386 /** The caller DOES NOT get ownership of the strings. That is he
387 does not need to release the strings.
388 The array exists as long as this object exists.
389 */
391
390
392 rtl_uString** getExcludeVersions();
393 sal_Int32 getExcludeVersionSize();
394};
395
396struct PluginLibrary
397{
398 PluginLibrary()
399 {

--- 15 unchanged lines hidden ---
391 rtl_uString** getExcludeVersions();
392 sal_Int32 getExcludeVersionSize();
393};
394
395struct PluginLibrary
396{
397 PluginLibrary()
398 {

--- 15 unchanged lines hidden ---