geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r572547 - /geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExitNotification.java
Date Tue, 04 Sep 2007 06:22:15 GMT
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();
     }
 }



Mime
View raw message