You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/03/05 10:46:27 UTC

svn commit: r1574404 - in /ofbiz/trunk: build.xml framework/start/src/org/ofbiz/base/start/Config.java

Author: jleroux
Date: Wed Mar  5 09:46:26 2014
New Revision: 1574404

URL: http://svn.apache.org/r1574404
Log:
Completes descriptions of ant targets which have portoffset parameter
Completes code in Config.java for start-debug only (adds "start-debug" to pick start.properties when portoffset is used). 
The rest of the changes is only refactoring to have the replacement to pick start.properties only in getInstance()

Modified:
    ofbiz/trunk/build.xml
    ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java

Modified: ofbiz/trunk/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=1574404&r1=1574403&r2=1574404&view=diff
==============================================================================
--- ofbiz/trunk/build.xml (original)
+++ ofbiz/trunk/build.xml Wed Mar  5 09:46:26 2014
@@ -421,7 +421,7 @@ under the License.
         </java>
     </target>
     <target name="start-batch"
-            description="Start OFBiz as a separate process">
+            description="Start OFBiz as a separate process. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
         <java jar="ofbiz.jar" fork="true" spawn="true">
             <jvmarg value="${memory.initial.param}"/>
             <jvmarg value="${memory.max.param}"/>
@@ -431,7 +431,7 @@ under the License.
         </java>
     </target>
     <target name="start-debug"
-            description="Start OFBiz in debugging mode. It uses the 8091 port by default">
+            description="Start OFBiz in debugging mode. It uses the 8091 port by default. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
         <java jar="ofbiz.jar" fork="true">
             <jvmarg value="${memory.initial.param}"/>
             <jvmarg value="${memory.max.param}"/>
@@ -440,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="start-debug"/>
             <arg value="-portoffset=${portoffset}"/>
         </java>
     </target>
@@ -464,14 +465,14 @@ under the License.
         </java>
     </target>
     <target name="stop"
-            description="Stop OFBiz">
+            description="Stop OFBiz. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
         <java jar="ofbiz.jar" fork="true">
             <arg value="-shutdown"/>
             <arg value="-portoffset=${portoffset}"/>
         </java>
     </target>
     <target name="status"
-            description="Display status of OFBiz">
+            description="Display status of OFBiz. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
         <java jar="ofbiz.jar" fork="true">
             <arg value="-status"/>
             <arg value="-portoffset=${portoffset}"/>

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=1574404&r1=1574403&r2=1574404&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 Wed Mar  5 09:46:26 2014
@@ -44,19 +44,17 @@ public class Config {
         if (command.startsWith("-")) {
             command = command.substring(1);
         }
-        // shutdown & status hack
-        if (command.equalsIgnoreCase("shutdown")) {
-            command = "start";
-        } else if (command.equalsIgnoreCase("status")) {
-            command = "start";
-        }
         return "org/ofbiz/base/start/" + command + ".properties";
     }
 
     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)) {
+        // Needed when portoffset is used with these commands, start.properties fits for all of them
+        if ("start-batch".equalsIgnoreCase(firstArg) 
+                || "start-debug".equalsIgnoreCase(firstArg) 
+                || "stop".equalsIgnoreCase(firstArg) 
+                || "shutdown".equalsIgnoreCase(firstArg) // shutdown & status hack (was pre-existing to portoffset introduction, also useful with it) 
+                || "status".equalsIgnoreCase(firstArg)) {
             firstArg = "start";
         }
         String configFileName = getConfigFileName(firstArg);