KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > util > loader > ReturnCode


1 /**
2   ReturnCode - If some element of loadjobs fails, the java.exe has to return
3   a ReturnCode to the environment.
4
5     Copyright (C) 2002-2003 Together
6
7     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public
9     License as published by the Free Software Foundation; either
10     version 2.1 of the License, or (at your option) any later version.
11
12     This library is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     Lesser General Public License for more details.
16
17     You should have received a copy of the GNU Lesser General Public
18     License along with this library; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21  ReturnCode.java
22  Date: 01.03.2003.
23  Author: Milosevic Sinisa sinisa@prozone.co.yu
24  @version 1.0.0
25  */

26
27 package org.webdocwf.util.loader;
28
29 /**
30   ReturnCode - If some element of loadjobs fails, the java.exe has to return
31   a ReturnCode to the environment.
32 */

33 public class ReturnCode {
34
35   private static int returnError=1;
36   private static int defaultReturnError=1;
37   private static int returnOK=0;
38   public static boolean isParameter=false;
39
40
41   /**
42    * Read return code for normal end of java program
43    * @return int return code
44    */

45   public static int getOKReturnCode() {
46     return returnOK;
47   }
48
49
50   /**
51    * Set return code for normal end of program.
52    * @param code is new value of return code.
53    */

54   public static void setOKReturnCode(int code) {
55     returnOK=code;
56   }
57
58
59   /**
60    * Read current error return code
61    * @return int return code
62    */

63   public static int getErrorReturnCode() {
64     return returnError;
65   }
66
67
68   /**
69    * Set current error return code.
70    * @param code is new value of return code.
71    */

72   public static void setErrorReturnCode(int code) {
73     returnError=code;
74   }
75
76
77   /**
78    * Read default error return code
79    * @return int return code
80    */

81   public static int getDefaultErrorReturnCode() {
82     return defaultReturnError;
83   }
84
85
86   /**
87    * Set default error return code.
88    * @param code is new value of default return code.
89    */

90   public static void setDefaultErrorReturnCode(int code) {
91     defaultReturnError=code;
92   }
93
94 }
Popular Tags