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 2007/09/04 08:22:15 UTC

svn commit: r572547 - /geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java

Author: jdillon
Date: Mon Sep  3 23:22:14 2007
New Revision: 572547

URL: http://svn.apache.org/viewvc?rev=572547&view=rev
Log:
Minor fluff for the exit handling muck

Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java?rev=572547&r1=572546&r2=572547&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java Mon Sep  3 23:22:14 2007
@@ -24,16 +24,15 @@
 /**
  * Thrown to indicate that the current shell should exit.
  *
- * <p>
- * Commands should use this instead of {@link System#exit}.
- *
  * @version $Rev$ $Date$
  */
 public class ExitNotification
     extends Notification
 {
     ///CLOVER:OFF
-    
+
+    public static final int DEFAULT_CODE = 0;
+
     private final int code;
 
     public ExitNotification(final int code) {
@@ -41,10 +40,18 @@
     }
 
     public ExitNotification() {
-        this(0);
+        this(DEFAULT_CODE);
     }
 
     public int getCode() {
         return code;
+    }
+
+    public static void exit(final int code) {
+        throw new ExitNotification(code);
+    }
+
+    public static void exit() {
+        throw new ExitNotification();
     }
 }