KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > martiansoftware > nailgun > NGExitException


1 /*
2
3   Copyright 2004, Martian Software, Inc.
4
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8
9   http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16
17 */

18
19 package com.martiansoftware.nailgun;
20
21 import java.io.PrintStream JavaDoc;
22
23 import org.apache.tools.ant.ExitException;
24
25 /**
26  * Security exception which wraps an exit status code.
27  * @author Pete Kirkham
28  */

29 public class NGExitException extends ExitException {
30         public NGExitException(int status) {
31                 super(status);
32         }
33   
34         /**
35          * A lot of code out there, for example ant's Launcher,
36          * runs inside a try/catch (Throwable) which will squash
37          * this exception; most also calll printStackTrace(), so
38          * this re-throws the exception to escape the handling code.
39          */

40         public void printStackTrace (PrintStream JavaDoc out) {
41                 throw this;
42         }
43         
44         public void reallyPrintStackTrace (PrintStream JavaDoc out) {
45                 super.printStackTrace(out);
46         }
47 }
Popular Tags