Author: jleroux Date: Tue Mar 4 21:02:13 2014 New Revision: 1574201 URL: http://svn.apache.org/r1574201 Log: Running OFBiz with start-batch, stopping it then or checking its status was missing, this completes these aspects.
Modified: ofbiz/trunk/build.xml ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Modified: ofbiz/trunk/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=1574201&r1=1574200&r2=1574201&view=diff ============================================================================== --- ofbiz/trunk/build.xml (original) +++ ofbiz/trunk/build.xml Tue Mar 4 21:02:13 2014 @@ -426,6 +426,8 @@ under the License. <jvmarg value="${memory.initial.param}"/> <jvmarg value="${memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> + <arg value="start-batch"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="start-debug" @@ -438,6 +440,7 @@ under the License. <jvmarg value="-Djava.compiler=NONE"/> <jvmarg value="-Xdebug"/> <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="start-pos" @@ -447,7 +450,7 @@ under the License. <jvmarg value="${memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> <arg value="pos"/> - <arg value="-portoffset=${portoffset}"/> + <arg value="-portoffset=${portoffset}"/><!-- Not sure this makes sense and is useful at all --> </java> </target> <target name="start-both" @@ -464,12 +467,14 @@ under the License. description="Stop OFBiz"> <java jar="ofbiz.jar" fork="true"> <arg value="-shutdown"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="status" description="Display status of OFBiz"> <java jar="ofbiz.jar" fork="true"> <arg value="-status"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1574201&r1=1574200&r2=1574201&view=diff ============================================================================== --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java (original) +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java Tue Mar 4 21:02:13 2014 @@ -55,6 +55,10 @@ public class Config { public static Config getInstance(String[] args) throws IOException { String firstArg = args.length > 0 ? args[0] : ""; + // Needed when portoffset is used with these commands + if ("start-batch".equals(firstArg) || "stop".equals(firstArg)) { + firstArg = "start"; + } String configFileName = getConfigFileName(firstArg); Config result = new Config(); result.readConfig(configFileName, args); Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java?rev=1574201&r1=1574200&r2=1574201&view=diff ============================================================================== --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java (original) +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Tue Mar 4 21:02:13 2014 @@ -87,7 +87,9 @@ public final class Start { } else if (arg.equals("-shutdown")) { command = checkCommand(command, Command.SHUTDOWN); } else if (arg.startsWith("-")) { - command = checkCommand(command, Command.COMMAND); + if (!arg.contains("portoffset")) { + command = checkCommand(command, Command.COMMAND); + } loaderArgs.add(arg.substring(1)); } else { command = checkCommand(command, Command.COMMAND); @@ -189,6 +191,17 @@ public final class Start { // parse the startup arguments if (args.length > 1) { this.loaderArgs.addAll(Arrays.asList(args).subList(1, args.length)); + // Needed when portoffset is used with these commands + try { + if ("status".equals(args[0])) { + System.out.println("Current Status : " + instance.status()); + } else if ("stop".equals(args[0])) { + System.out.println("Shutting down server : " + instance.shutdown()); + } + } catch (Exception e) { + e.printStackTrace(); + System.exit(99); + } } if (!fullInit) { return;