128 } |
128 } |
129 } |
129 } |
130 |
130 |
131 // Runtime. |
131 // Runtime. |
132 config->GetValue(keys[CONFIG_SECTION_APPLICATION], |
132 config->GetValue(keys[CONFIG_SECTION_APPLICATION], |
133 keys[JVM_RUNTIME_KEY], FBootFields->FJVMRuntimeDirectory); |
133 keys[JAVA_RUNTIME_KEY], FBootFields->FJavaRuntimeDirectory); |
134 |
134 |
135 // Read jvmargs. |
135 // Read jvmargs. |
136 PromoteAppCDSState(config); |
136 PromoteAppCDSState(config); |
137 ReadJVMArgs(config); |
137 ReadJavaOptions(config); |
138 |
138 |
139 // Read args if none were passed in. |
139 // Read args if none were passed in. |
140 if (FBootFields->FArgs.size() == 0) { |
140 if (FBootFields->FArgs.size() == 0) { |
141 OrderedMap<TString, TString> args; |
141 OrderedMap<TString, TString> args; |
142 |
142 |
235 } |
235 } |
236 } |
236 } |
237 } |
237 } |
238 } |
238 } |
239 |
239 |
240 void Package::ReadJVMArgs(ISectionalPropertyContainer* Config) { |
240 void Package::ReadJavaOptions(ISectionalPropertyContainer* Config) { |
241 Platform& platform = Platform::GetInstance(); |
241 Platform& platform = Platform::GetInstance(); |
242 std::map<TString, TString> keys = platform.GetKeys(); |
242 std::map<TString, TString> keys = platform.GetKeys(); |
243 |
243 |
244 // Evaluate based on the current AppCDS state. |
244 // Evaluate based on the current AppCDS state. |
245 switch (platform.GetAppCDSState()) { |
245 switch (platform.GetAppCDSState()) { |
247 throw Exception(_T("Internal Error")); |
247 throw Exception(_T("Internal Error")); |
248 } |
248 } |
249 |
249 |
250 case cdsDisabled: { |
250 case cdsDisabled: { |
251 Config->GetSection(keys[CONFIG_SECTION_JAVAOPTIONS], |
251 Config->GetSection(keys[CONFIG_SECTION_JAVAOPTIONS], |
252 FBootFields->FJVMArgs); |
252 FBootFields->FJavaOptions); |
253 break; |
253 break; |
254 } |
254 } |
255 |
255 |
256 case cdsGenCache: { |
256 case cdsGenCache: { |
257 Config->GetSection(keys[ |
257 Config->GetSection(keys[ |
258 CONFIG_SECTION_APPCDSGENERATECACHEJAVAOPTIONS], |
258 CONFIG_SECTION_APPCDSGENERATECACHEJAVAOPTIONS], |
259 FBootFields->FJVMArgs); |
259 FBootFields->FJavaOptions); |
260 break; |
260 break; |
261 } |
261 } |
262 |
262 |
263 case cdsAuto: |
263 case cdsAuto: |
264 case cdsEnabled: { |
264 case cdsEnabled: { |
355 delete FBootFields; |
355 delete FBootFields; |
356 FBootFields = NULL; |
356 FBootFields = NULL; |
357 } |
357 } |
358 } |
358 } |
359 |
359 |
360 OrderedMap<TString, TString> Package::GetJVMArgs() { |
360 OrderedMap<TString, TString> Package::GetJavaOptions() { |
361 return FBootFields->FJVMArgs; |
361 return FBootFields->FJavaOptions; |
362 } |
362 } |
363 |
363 |
364 std::vector<TString> GetKeysThatAreNotDuplicates(OrderedMap<TString, |
364 std::vector<TString> GetKeysThatAreNotDuplicates(OrderedMap<TString, |
365 TString> &Defaults, OrderedMap<TString, TString> &Overrides) { |
365 TString> &Defaults, OrderedMap<TString, TString> &Overrides) { |
366 std::vector<TString> result; |
366 std::vector<TString> result; |
512 TString Package::GetMainClassName() { |
512 TString Package::GetMainClassName() { |
513 assert(FBootFields != NULL); |
513 assert(FBootFields != NULL); |
514 return FBootFields->FMainClassName; |
514 return FBootFields->FMainClassName; |
515 } |
515 } |
516 |
516 |
517 TString Package::GetJVMLibraryFileName() { |
517 TString Package::GetJavaLibraryFileName() { |
518 assert(FBootFields != NULL); |
518 assert(FBootFields != NULL); |
519 |
519 |
520 if (FBootFields->FJVMLibraryFileName.empty() == true) { |
520 if (FBootFields->FJavaLibraryFileName.empty() == true) { |
521 Platform& platform = Platform::GetInstance(); |
521 Platform& platform = Platform::GetInstance(); |
522 Macros& macros = Macros::GetInstance(); |
522 Macros& macros = Macros::GetInstance(); |
523 TString jvmRuntimePath = macros.ExpandMacros(GetJVMRuntimeDirectory()); |
523 TString jvmRuntimePath = macros.ExpandMacros(GetJavaRuntimeDirectory()); |
524 FBootFields->FJVMLibraryFileName = |
524 FBootFields->FJavaLibraryFileName = |
525 platform.GetBundledJVMLibraryFileName(jvmRuntimePath); |
525 platform.GetBundledJavaLibraryFileName(jvmRuntimePath); |
526 } |
526 } |
527 |
527 |
528 return FBootFields->FJVMLibraryFileName; |
528 return FBootFields->FJavaLibraryFileName; |
529 } |
529 } |
530 |
530 |
531 TString Package::GetJVMRuntimeDirectory() { |
531 TString Package::GetJavaRuntimeDirectory() { |
532 assert(FBootFields != NULL); |
532 assert(FBootFields != NULL); |
533 return FBootFields->FJVMRuntimeDirectory; |
533 return FBootFields->FJavaRuntimeDirectory; |
534 } |
534 } |
535 |
535 |
536 TString Package::GetSplashScreenFileName() { |
536 TString Package::GetSplashScreenFileName() { |
537 assert(FBootFields != NULL); |
537 assert(FBootFields != NULL); |
538 return FBootFields->FSplashScreenFileName; |
538 return FBootFields->FSplashScreenFileName; |