From e793c85eb445ccb24c5b25bfade44e24d892077e Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 8 Apr 2014 06:45:04 -0700 Subject: [PATCH] Cleanup and documentation of StartArgs in prep for extra-start-dirs --- .../java/org/eclipse/jetty/start/Main.java | 4 +- .../org/eclipse/jetty/start/StartArgs.java | 52 +++++++++++++------ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 9261397ed8b..3b9dd44623a 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -683,13 +683,13 @@ public class Main } // Initialize start.ini - for (String module : args.getModuleStartIni()) + for (String module : args.getAddToStartIni()) { moduleIni(args,module,true,true); } // Initialize start.d - for (String module : args.getModuleStartdIni()) + for (String module : args.getAddToStartdIni()) { moduleIni(args,module,true,false); } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index 4daa0ac1af8..2419d509dc8 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -69,23 +69,41 @@ public class StartArgs private static final String SERVER_MAIN = "org.eclipse.jetty.xml.XmlConfiguration"; private List commandLine = new ArrayList<>(); + /** List of enabled modules */ private Set modules = new HashSet<>(); + /** Map of enabled modules to the source of where that activation occurred */ private Map> sources = new HashMap<>(); + /** Map of properties to where that property was declared */ + private Map propertySource = new HashMap<>(); + /** List of all active [files] sections from enabled modules */ private List files = new ArrayList<>(); + /** List of all active [lib] sectinos from enabled modules */ private Classpath classpath; - private List xmlRefs = new ArrayList<>(); + /** List of all active [xml] sections from enabled modules */ private List xmls = new ArrayList<>(); + /** JVM arguments, found via commmand line and in all active [exec] sections from enabled modules */ + private List jvmArgs = new ArrayList<>(); + + /** List of all xml references found directly on command line or start.ini */ + private List xmlRefs = new ArrayList<>(); + private Props properties = new Props(); private Set systemPropertyKeys = new HashSet<>(); - private List jvmArgs = new ArrayList<>(); private List rawLibs = new ArrayList<>(); - private List moduleStartdIni = new ArrayList<>(); - private List moduleStartIni = new ArrayList<>(); - private Map propertySource = new HashMap<>(); + + // jetty.base - build out commands + /** --add-to-startd=[module,[module]] */ + private List addToStartdIni = new ArrayList<>(); + /** --add-to-start=[module,[module]] */ + private List addToStartIni = new ArrayList<>(); + + // module inspection commands + /** --write-module-graph=[filename] */ private String moduleGraphFilename; + /** Collection of all modules */ private Modules allModules; - // Should the server be run? + /** Should the server be run? */ private boolean run = true; private boolean download = false; private boolean help = false; @@ -309,7 +327,7 @@ public class StartArgs System.setProperty(key,val); } } - + /** * Expand any command line added --lib lib references. * @@ -348,7 +366,7 @@ public class StartArgs StartLog.debug("rawlibref = " + rawlibref); String libref = properties.expand(rawlibref); StartLog.debug("expanded = " + libref); - + for (Path libpath : baseHome.getPaths(libref)) { classpath.addComponent(libpath.toFile()); @@ -357,10 +375,10 @@ public class StartArgs for (String jvmArg : module.getJvmArgs()) { - exec=true; + exec = true; jvmArgs.add(jvmArg); } - + // Find and Expand XML files for (String xmlRef : module.getXmls()) { @@ -475,14 +493,14 @@ public class StartArgs return moduleGraphFilename; } - public List getModuleStartdIni() + public List getAddToStartdIni() { - return moduleStartdIni; + return addToStartdIni; } - public List getModuleStartIni() + public List getAddToStartIni() { - return moduleStartIni; + return addToStartIni; } public Props getProperties() @@ -744,7 +762,7 @@ public class StartArgs if (arg.startsWith("--lib=")) { String cp = getValue(arg); - + if (cp != null) { StringTokenizer t = new StringTokenizer(cp,File.pathSeparator); @@ -770,7 +788,7 @@ public class StartArgs { throw new UsageException(ERR_BAD_ARG,"%s not allowed in %s",arg,source); } - moduleStartdIni.addAll(getValues(arg)); + addToStartdIni.addAll(getValues(arg)); run = false; download = true; return; @@ -782,7 +800,7 @@ public class StartArgs { throw new UsageException(ERR_BAD_ARG,"%s not allowed in %s",arg,source); } - moduleStartIni.addAll(getValues(arg)); + addToStartIni.addAll(getValues(arg)); run = false; download = true; return;