1 | /*
|
---|
2 | * Copyright 2001-2004 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Used to report exit status of classes which call System.exit().
|
---|
21 | *
|
---|
22 | * @see org.apache.tools.ant.util.optional.NoExitSecurityManager
|
---|
23 | * @see org.apache.tools.ant.types.Permissions
|
---|
24 | *
|
---|
25 | */
|
---|
26 | public class ExitException extends SecurityException {
|
---|
27 |
|
---|
28 | /** Status code */
|
---|
29 | private int status;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Constructs an exit exception.
|
---|
33 | * @param status the status code returned via System.exit()
|
---|
34 | */
|
---|
35 | public ExitException(int status) {
|
---|
36 | super("ExitException: status " + status);
|
---|
37 | this.status = status;
|
---|
38 | }
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Constructs an exit exception.
|
---|
42 | * @param msg the message to be displayed.
|
---|
43 | * @param status the status code returned via System.exit()
|
---|
44 | */
|
---|
45 | public ExitException(String msg, int status) {
|
---|
46 | super(msg);
|
---|
47 | this.status = status;
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * The status code returned by System.exit()
|
---|
52 | *
|
---|
53 | * @return the status code returned by System.exit()
|
---|
54 | */
|
---|
55 | public int getStatus() {
|
---|
56 | return status;
|
---|
57 | }
|
---|
58 | }
|
---|