Support app_id-prefixed jvmarg parameters.
This makes sense given that we already support app_id-prefixed apparg parameters, and one might want to configure the JVM specially for different apps from the same installation. Note: unlike apparg, app_id-prefixed jvmargs are appended to un-prefixed jvmargs rather than replacing them. I think this makes sense because you probably want to specify standard JVM args and then maybe tweak a thing or two for your other app. This is also backward compatible which is usually a good thing. It does mean that it's harder to "undo" a jvmarg set for your "default" app, in such cases you'd probably have to not have a default app and instead identify all of your apps with app_ids.
This commit is contained in:
@@ -528,10 +528,10 @@ public class Application
|
||||
}
|
||||
}
|
||||
|
||||
String prefix = StringUtil.isBlank(_appid) ? "" : (_appid + ".");
|
||||
String appPrefix = StringUtil.isBlank(_appid) ? "" : (_appid + ".");
|
||||
|
||||
// determine our application class name
|
||||
_class = (String)cdata.get(prefix + "class");
|
||||
_class = (String)cdata.get(appPrefix + "class");
|
||||
if (_class == null) {
|
||||
throw new IOException("m.missing_class");
|
||||
}
|
||||
@@ -622,9 +622,13 @@ public class Application
|
||||
_auxgroups.put(auxgroup, new AuxGroup(auxgroup, codes, rsrcs));
|
||||
}
|
||||
|
||||
// transfer our JVM arguments
|
||||
// transfer our JVM arguments (we include both "global" args and app_id-prefixed args)
|
||||
String[] jvmargs = ConfigUtil.getMultiValue(cdata, "jvmarg");
|
||||
addAll(jvmargs, _jvmargs);
|
||||
if (appPrefix.length() > 0) {
|
||||
jvmargs = ConfigUtil.getMultiValue(cdata, appPrefix + "jvmarg");
|
||||
addAll(jvmargs, _jvmargs);
|
||||
}
|
||||
|
||||
// Add the launch specific JVM arguments
|
||||
addAll(_extraJvmArgs, _jvmargs);
|
||||
@@ -633,7 +637,7 @@ public class Application
|
||||
_optimumJvmArgs = ConfigUtil.getMultiValue(cdata, "optimum_jvmarg");
|
||||
|
||||
// transfer our application arguments
|
||||
String[] appargs = ConfigUtil.getMultiValue(cdata, prefix + "apparg");
|
||||
String[] appargs = ConfigUtil.getMultiValue(cdata, appPrefix + "apparg");
|
||||
addAll(appargs, _appargs);
|
||||
|
||||
// add the launch specific application arguments
|
||||
|
||||
Reference in New Issue
Block a user