You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/10/21 17:08:40 UTC
svn commit: r706651 -
/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Author: jdillon
Date: Tue Oct 21 08:08:40 2008
New Revision: 706651
URL: http://svn.apache.org/viewvc?rev=706651&view=rev
Log:
Allow System.exit() to be avoided (for perf tests)
Modified:
geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Modified: geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=706651&r1=706650&r2=706651&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java (original)
+++ geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java Tue Oct 21 08:08:40 2008
@@ -47,6 +47,8 @@
*/
public class Main
{
+ private static final boolean BYPASS_EXIT = Boolean.getBoolean(Main.class.getName() + ".bypassExit");
+
//
// NOTE: Do not use logging from this class, as it is used to configure
// the logging level with System properties, which will only get
@@ -169,7 +171,7 @@
System.setProperty("jline.terminal", type);
}
- public void boot(final String[] args) throws Exception {
+ public int boot(final String[] args) throws Exception {
assert args != null;
System.setProperty("jline.terminal", AutoDetectedTerminal.class.getName());
@@ -249,12 +251,17 @@
codeRef.set(code);
- System.exit(code);
+ return code;
}
public static void main(final String[] args) throws Exception {
Main main = new Main();
- main.boot(args);
+
+ int code = main.boot(args);
+
+ if (!BYPASS_EXIT) {
+ System.exit(code);
+ }
}
}