_envc = envc;
_config = getLocalPath(envc.appDir, CONFIG_FILE);
_backupConfig = getLocalPath(envc.appDir, BACKUP_CONFIG_DIR + File.separator + CONFIG_FILE);
- log.warning("##### SET _config to", "_config", _config.getAbsolutePath());
}
/**
* during its parsing.
*/
public Config init (boolean checkPlatform) throws IOException {
- /*#####
- return init(checkPlatform, false);
- }
-
- public Config init (boolean checkPlatform, boolean secondCall)
- throws IOException
- {
- */
if (_initialised && _initialisedConfig != null)
{
return _initialisedConfig;
// merge the locator file config into config (or replace config with)
if (locatorConfig != null) {
- //##### if (config == null || locatorConfig.getBoolean(LOCATOR_FILE_EXTENSION+"_replace") || (locatorConfig.hasValue("appbase") && !secondCall)) {
if (config == null || locatorConfig.getBoolean(LOCATOR_FILE_EXTENSION+"_replace")) {
config = locatorConfig;
log.warning("Replacing config with locator file", LOCATOR_FILE_EXTENSION+"_file", locatorConfig);
// process, our caller can use the appbase to download a new configuration file
_appbase = config.getString("appbase");
- /* #####
- // see if locatorConfig override
- if (!secondCall && locatorConfig != null && !StringUtil.isBlank(locatorConfig.getString("appbase"))) {
- String lAppbase = locatorConfig.getString("appbase");
- if (lAppbase != null && !lAppbase.endsWith("/")) {
- lAppbase = lAppbase + "/";
- }
- if (lAppbase != null && !lAppbase.equals(_appbase)) {
- _appbase = lAppbase;
- // get new getdown.txt
- log.warning("Attempting to download new getdown.txt from " + _appbase + " and use that");
- updateMetadata();
- setLocatorFile(null);
- return init(checkPlatform, true);
- }
- }
- */
-
if (_appbase == null) {
throw new RuntimeException("m.missing_appbase");
}
}
public boolean updateMetadataAndRelaunch(String newAppbase, Class startClass, String locatorFileArg, String[] argv, List<Note> notes) {
+ if (Boolean.parseBoolean(System.getProperty(NOJVLAPPBASERELAUNCH))) {
+ notes.add(Note.warn("System property " + NOJVLAPPBASERELAUNCH + " is set, not attempting jvl appbase relaunch"));
+ return false;
+ }
+
_appbase = newAppbase;
try {
updateMetadata();
removeJvmArgs.add("-Xdock:name=");
addJvmArgs.add("-Xdock:name=" + ( appName != null ? appName : ChannelProperties.FALLBACK_APPNAME ));
}
+ addJvmArgs.add("-D" + NOJVLAPPBASERELAUNCH + "=true");
List<String> removeArgs = new ArrayList<>();
if (locatorFileArg != null) {
public static String i4jVersion = null;
private String jvmmempc = null;
private String jvmmemmax = null;
+
+ private static final String NOJVLAPPBASERELAUNCH = "launcher.NO_JVL_APPBASE_RELAUNCH";
}
String locatorFile = Application.getLocatorFile();
if (locatorFile != null) {
- String lfAppbase = app.getApplication().getEnvConfig().getLocatorFileAppBase(locatorFile);
- if (lfAppbase != null && !lfAppbase.equals(app.getApplication().getAppbase())) {
+ String lfAppbase = HttpUtils.equivalentJalviewUrl(app.getApplication().getEnvConfig().getLocatorFileAppBase(locatorFile));
+ String oldAppbase = HttpUtils.equivalentJalviewUrl(app.getApplication().getAppbase());
+ if (lfAppbase != null && !lfAppbase.equals(oldAppbase)) {
- /** ######
- * DO METADATA DOWNLOAD AND RESLAUNCH GETDOWN WITH DON'T RESTART PROPERTY (MAKE IT UP) HERE!
- */
notes = new ArrayList<>();
boolean relaunched = app.getApplication().updateMetadataAndRelaunch(lfAppbase, GetdownApp.class, locatorFile, argv, notes);