Skip to content
Browse files

Merge pull request #22 from jeffbski/master

added system property to allow JarMain to not use System.exit in normal flow, this was causing problem when using a service wrapper
  • Loading branch information...
2 parents 8056701 + 553cda7 commit 58ecd078cb22c0e623d8bacdbfba3e6a2aff48c8 @BanzaiMan BanzaiMan committed Jan 30, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 ext/JarMain.java
View
11 ext/JarMain.java
@@ -129,7 +129,7 @@ public void run() {
public static void main(String[] args) {
try {
int exit = new JarMain(args).start();
- System.exit(exit);
+ if(isSystemExitEnabled()) System.exit(exit);
} catch (Exception e) {
Throwable t = e;
while (t.getCause() != null && t.getCause() != t) {
@@ -146,4 +146,13 @@ public static void main(String[] args) {
private static boolean isDebug() {
return System.getProperty("warbler.debug") != null;
}
+
+ /**
+ * if warbler.skip_system_exit system property is defined, we will not
+ * call System.exit in the normal flow. System.exit can cause problems
+ * for wrappers like procrun
+ */
+ private static boolean isSystemExitEnabled(){
+ return System.getProperty("warbler.skip_system_exit") == null; //omission enables System.exit use
+ }
}

0 comments on commit 58ecd07

Please sign in to comment.
Something went wrong with that request. Please try again.