modules/fxpackager/src/main/native/library/common/main.cpp

Print this page




 153 
 154                         if (FilePath::FileExists(cacheFileName) == false) {
 155                             // Cache does not exist after trying to generate it,
 156                             // so run without cache.
 157                             platform.SetAppCDSState(cdsNone);
 158                             package.Clear();
 159                             package.Initialize();
 160                         }
 161                     }
 162 
 163                     break;
 164                 }
 165 
 166                 case cdsNone:
 167                 case cdsOn: {
 168                     break;
 169                 }
 170             }
 171 
 172             // Validation
 173             {

 174                 switch (platform.GetAppCDSState()) {
 175                     case cdsOn:
 176                     case cdsAuto: {
 177                             TString cacheFileName = package.GetAppCDSCacheFileName();
 178 
 179                             if (FilePath::FileExists(cacheFileName) == false) {
 180                                 Messages& messages = Messages::GetInstance();
 181                                 TString message = PlatformString::Format(messages.GetMessage(APPCDS_CACHE_FILE_NOT_FOUND), cacheFileName.data());
 182                                 throw FileNotFoundException(message);
 183                             }
 184                             break;
 185                         }
 186                 }
 187             }
 188 
 189             TString logFileName = FilePath::IncludeTrailingSeparater(platform.GetAppDataDirectory().data()) + _T("log.txt");
 190 
 191             // Run App
 192             result = RunVM();
 193         }


 153 
 154                         if (FilePath::FileExists(cacheFileName) == false) {
 155                             // Cache does not exist after trying to generate it,
 156                             // so run without cache.
 157                             platform.SetAppCDSState(cdsNone);
 158                             package.Clear();
 159                             package.Initialize();
 160                         }
 161                     }
 162 
 163                     break;
 164                 }
 165 
 166                 case cdsNone:
 167                 case cdsOn: {
 168                     break;
 169                 }
 170             }
 171 
 172             // Validation
 173             AutoFreePtr<ISectionalPropertyContainer> config = platform.GetConfigFile(platform.GetConfigFileName());
 174             if (config->ContainsSection("AppCDSJVMOptions")) {
 175                 switch (platform.GetAppCDSState()) {
 176                     case cdsOn:
 177                     case cdsAuto: {
 178                             TString cacheFileName = package.GetAppCDSCacheFileName();
 179 
 180                             if (FilePath::FileExists(cacheFileName) == false) {
 181                                 Messages& messages = Messages::GetInstance();
 182                                 TString message = PlatformString::Format(messages.GetMessage(APPCDS_CACHE_FILE_NOT_FOUND), cacheFileName.data());
 183                                 throw FileNotFoundException(message);
 184                             }
 185                             break;
 186                         }
 187                 }
 188             }
 189 
 190             TString logFileName = FilePath::IncludeTrailingSeparater(platform.GetAppDataDirectory().data()) + _T("log.txt");
 191 
 192             // Run App
 193             result = RunVM();
 194         }