KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tomcat > jni > Status


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. 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 package org.apache.tomcat.jni;
19
20 /** Status
21  *
22  * @author Mladen Turk
23  * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
24  */

25
26 public class Status {
27
28     /**
29      * APR_OS_START_ERROR is where the APR specific error values start.
30      */

31      public static final int APR_OS_START_ERROR = 20000;
32     /**
33      * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
34      * into one of the error/status ranges below -- except for
35      * APR_OS_START_USERERR, which see.
36      */

37      public static final int APR_OS_ERRSPACE_SIZE = 50000;
38     /**
39      * APR_OS_START_STATUS is where the APR specific status codes start.
40      */

41      public static final int APR_OS_START_STATUS = (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE);
42
43     /**
44      * APR_OS_START_USERERR are reserved for applications that use APR that
45      * layer their own error codes along with APR's. Note that the
46      * error immediately following this one is set ten times farther
47      * away than usual, so that users of apr have a lot of room in
48      * which to declare custom error codes.
49      */

50     public static final int APR_OS_START_USERERR = (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE);
51     /**
52      * APR_OS_START_USEERR is obsolete, defined for compatibility only.
53      * Use APR_OS_START_USERERR instead.
54      */

55     public static final int APR_OS_START_USEERR = APR_OS_START_USERERR;
56     /**
57      * APR_OS_START_CANONERR is where APR versions of errno values are defined
58      * on systems which don't have the corresponding errno.
59      */

60     public static final int APR_OS_START_CANONERR = (APR_OS_START_USERERR + (APR_OS_ERRSPACE_SIZE * 10));
61
62     /**
63      * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into
64      * apr_status_t values.
65      */

66     public static final int APR_OS_START_EAIERR = (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE);
67     /**
68      * APR_OS_START_SYSERR folds platform-specific system error values into
69      * apr_status_t values.
70      */

71     public static final int APR_OS_START_SYSERR = (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE);
72
73     /** no error. */
74     public static final int APR_SUCCESS = 0;
75
76     /**
77      * APR Error Values
78      * <PRE>
79      * <b>APR ERROR VALUES</b>
80      * APR_ENOSTAT APR was unable to perform a stat on the file
81      * APR_ENOPOOL APR was not provided a pool with which to allocate memory
82      * APR_EBADDATE APR was given an invalid date
83      * APR_EINVALSOCK APR was given an invalid socket
84      * APR_ENOPROC APR was not given a process structure
85      * APR_ENOTIME APR was not given a time structure
86      * APR_ENODIR APR was not given a directory structure
87      * APR_ENOLOCK APR was not given a lock structure
88      * APR_ENOPOLL APR was not given a poll structure
89      * APR_ENOSOCKET APR was not given a socket
90      * APR_ENOTHREAD APR was not given a thread structure
91      * APR_ENOTHDKEY APR was not given a thread key structure
92      * APR_ENOSHMAVAIL There is no more shared memory available
93      * APR_EDSOOPEN APR was unable to open the dso object. For more
94      * information call apr_dso_error().
95      * APR_EGENERAL General failure (specific information not available)
96      * APR_EBADIP The specified IP address is invalid
97      * APR_EBADMASK The specified netmask is invalid
98      * APR_ESYMNOTFOUND Could not find the requested symbol
99      * </PRE>
100      *
101      */

102     public static final int APR_ENOSTAT = (APR_OS_START_ERROR + 1);
103     public static final int APR_ENOPOOL = (APR_OS_START_ERROR + 2);
104     public static final int APR_EBADDATE = (APR_OS_START_ERROR + 4);
105     public static final int APR_EINVALSOCK = (APR_OS_START_ERROR + 5);
106     public static final int APR_ENOPROC = (APR_OS_START_ERROR + 6);
107     public static final int APR_ENOTIME = (APR_OS_START_ERROR + 7);
108     public static final int APR_ENODIR = (APR_OS_START_ERROR + 8);
109     public static final int APR_ENOLOCK = (APR_OS_START_ERROR + 9);
110     public static final int APR_ENOPOLL = (APR_OS_START_ERROR + 10);
111     public static final int APR_ENOSOCKET = (APR_OS_START_ERROR + 11);
112     public static final int APR_ENOTHREAD = (APR_OS_START_ERROR + 12);
113     public static final int APR_ENOTHDKEY = (APR_OS_START_ERROR + 13);
114     public static final int APR_EGENERAL = (APR_OS_START_ERROR + 14);
115     public static final int APR_ENOSHMAVAIL = (APR_OS_START_ERROR + 15);
116     public static final int APR_EBADIP = (APR_OS_START_ERROR + 16);
117     public static final int APR_EBADMASK = (APR_OS_START_ERROR + 17);
118     public static final int APR_EDSOOPEN = (APR_OS_START_ERROR + 19);
119     public static final int APR_EABSOLUTE = (APR_OS_START_ERROR + 20);
120     public static final int APR_ERELATIVE = (APR_OS_START_ERROR + 21);
121     public static final int APR_EINCOMPLETE = (APR_OS_START_ERROR + 22);
122     public static final int APR_EABOVEROOT = (APR_OS_START_ERROR + 23);
123     public static final int APR_EBADPATH = (APR_OS_START_ERROR + 24);
124     public static final int APR_EPATHWILD = (APR_OS_START_ERROR + 25);
125     public static final int APR_ESYMNOTFOUND = (APR_OS_START_ERROR + 26);
126     public static final int APR_EPROC_UNKNOWN = (APR_OS_START_ERROR + 27);
127     public static final int APR_ENOTENOUGHENTROPY = (APR_OS_START_ERROR + 28);
128
129     /** APR Status Values
130      * <PRE>
131      * <b>APR STATUS VALUES</b>
132      * APR_INCHILD Program is currently executing in the child
133      * APR_INPARENT Program is currently executing in the parent
134      * APR_DETACH The thread is detached
135      * APR_NOTDETACH The thread is not detached
136      * APR_CHILD_DONE The child has finished executing
137      * APR_CHILD_NOTDONE The child has not finished executing
138      * APR_TIMEUP The operation did not finish before the timeout
139      * APR_INCOMPLETE The operation was incomplete although some processing
140      * was performed and the results are partially valid
141      * APR_BADCH Getopt found an option not in the option string
142      * APR_BADARG Getopt found an option that is missing an argument
143      * and an argument was specified in the option string
144      * APR_EOF APR has encountered the end of the file
145      * APR_NOTFOUND APR was unable to find the socket in the poll structure
146      * APR_ANONYMOUS APR is using anonymous shared memory
147      * APR_FILEBASED APR is using a file name as the key to the shared memory
148      * APR_KEYBASED APR is using a shared key as the key to the shared memory
149      * APR_EINIT Ininitalizer value. If no option has been found, but
150      * the status variable requires a value, this should be used
151      * APR_ENOTIMPL The APR function has not been implemented on this
152      * platform, either because nobody has gotten to it yet,
153      * or the function is impossible on this platform.
154      * APR_EMISMATCH Two passwords do not match.
155      * APR_EBUSY The given lock was busy.
156      * </PRE>
157      *
158      */

159     public static final int APR_INCHILD = (APR_OS_START_STATUS + 1);
160     public static final int APR_INPARENT = (APR_OS_START_STATUS + 2);
161     public static final int APR_DETACH = (APR_OS_START_STATUS + 3);
162     public static final int APR_NOTDETACH = (APR_OS_START_STATUS + 4);
163     public static final int APR_CHILD_DONE = (APR_OS_START_STATUS + 5);
164     public static final int APR_CHILD_NOTDONE = (APR_OS_START_STATUS + 6);
165     public static final int APR_TIMEUP = (APR_OS_START_STATUS + 7);
166     public static final int APR_INCOMPLETE = (APR_OS_START_STATUS + 8);
167     public static final int APR_BADCH = (APR_OS_START_STATUS + 12);
168     public static final int APR_BADARG = (APR_OS_START_STATUS + 13);
169     public static final int APR_EOF = (APR_OS_START_STATUS + 14);
170     public static final int APR_NOTFOUND = (APR_OS_START_STATUS + 15);
171     public static final int APR_ANONYMOUS = (APR_OS_START_STATUS + 19);
172     public static final int APR_FILEBASED = (APR_OS_START_STATUS + 20);
173     public static final int APR_KEYBASED = (APR_OS_START_STATUS + 21);
174     public static final int APR_EINIT = (APR_OS_START_STATUS + 22);
175     public static final int APR_ENOTIMPL = (APR_OS_START_STATUS + 23);
176     public static final int APR_EMISMATCH = (APR_OS_START_STATUS + 24);
177     public static final int APR_EBUSY = (APR_OS_START_STATUS + 25);
178
179     public static final int TIMEUP = (APR_OS_START_USERERR + 1);
180     public static final int EAGAIN = (APR_OS_START_USERERR + 2);
181     public static final int EINTR = (APR_OS_START_USERERR + 3);
182     public static final int EINPROGRESS = (APR_OS_START_USERERR + 4);
183     public static final int ETIMEDOUT = (APR_OS_START_USERERR + 5);
184
185     private static native boolean is(int err, int idx);
186     /**
187      * APR_STATUS_IS Status Value Tests
188      * <br /><b>Warning :</b> For any particular error condition, more than one of these tests
189      * may match. This is because platform-specific error codes may not
190      * always match the semantics of the POSIX codes these tests (and the
191      * corresponding APR error codes) are named after. A notable example
192      * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on
193      * Win32 platforms. The programmer should always be aware of this and
194      * adjust the order of the tests accordingly.
195      *
196      */

197     public static final boolean APR_STATUS_IS_ENOSTAT(int s) { return is(s, 1); }
198     public static final boolean APR_STATUS_IS_ENOPOOL(int s) { return is(s, 2); }
199     /* empty slot: +3 */
200     public static final boolean APR_STATUS_IS_EBADDATE(int s) { return is(s, 4); }
201     public static final boolean APR_STATUS_IS_EINVALSOCK(int s) { return is(s, 5); }
202     public static final boolean APR_STATUS_IS_ENOPROC(int s) { return is(s, 6); }
203     public static final boolean APR_STATUS_IS_ENOTIME(int s) { return is(s, 7); }
204     public static final boolean APR_STATUS_IS_ENODIR(int s) { return is(s, 8); }
205     public static final boolean APR_STATUS_IS_ENOLOCK(int s) { return is(s, 9); }
206     public static final boolean APR_STATUS_IS_ENOPOLL(int s) { return is(s, 10); }
207     public static final boolean APR_STATUS_IS_ENOSOCKET(int s) { return is(s, 11); }
208     public static final boolean APR_STATUS_IS_ENOTHREAD(int s) { return is(s, 12); }
209     public static final boolean APR_STATUS_IS_ENOTHDKEY(int s) { return is(s, 13); }
210     public static final boolean APR_STATUS_IS_EGENERAL(int s) { return is(s, 14); }
211     public static final boolean APR_STATUS_IS_ENOSHMAVAIL(int s){ return is(s, 15); }
212     public static final boolean APR_STATUS_IS_EBADIP(int s) { return is(s, 16); }
213     public static final boolean APR_STATUS_IS_EBADMASK(int s) { return is(s, 17); }
214     /* empty slot: +18 */
215     public static final boolean APR_STATUS_IS_EDSOPEN(int s) { return is(s, 19); }
216     public static final boolean APR_STATUS_IS_EABSOLUTE(int s) { return is(s, 20); }
217     public static final boolean APR_STATUS_IS_ERELATIVE(int s) { return is(s, 21); }
218     public static final boolean APR_STATUS_IS_EINCOMPLETE(int s){ return is(s, 22); }
219     public static final boolean APR_STATUS_IS_EABOVEROOT(int s) { return is(s, 23); }
220     public static final boolean APR_STATUS_IS_EBADPATH(int s) { return is(s, 24); }
221     public static final boolean APR_STATUS_IS_EPATHWILD(int s) { return is(s, 25); }
222     public static final boolean APR_STATUS_IS_ESYMNOTFOUND(int s) { return is(s, 26); }
223     public static final boolean APR_STATUS_IS_EPROC_UNKNOWN(int s) { return is(s, 27); }
224     public static final boolean APR_STATUS_IS_ENOTENOUGHENTROPY(int s) { return is(s, 28); }
225
226     /*
227      * APR_Error
228      */

229     public static final boolean APR_STATUS_IS_INCHILD(int s) { return is(s, 51); }
230     public static final boolean APR_STATUS_IS_INPARENT(int s) { return is(s, 52); }
231     public static final boolean APR_STATUS_IS_DETACH(int s) { return is(s, 53); }
232     public static final boolean APR_STATUS_IS_NOTDETACH(int s) { return is(s, 54); }
233     public static final boolean APR_STATUS_IS_CHILD_DONE(int s) { return is(s, 55); }
234     public static final boolean APR_STATUS_IS_CHILD_NOTDONE(int s) { return is(s, 56); }
235     public static final boolean APR_STATUS_IS_TIMEUP(int s) { return is(s, 57); }
236     public static final boolean APR_STATUS_IS_INCOMPLETE(int s) { return is(s, 58); }
237     /* empty slot: +9 */
238     /* empty slot: +10 */
239     /* empty slot: +11 */
240     public static final boolean APR_STATUS_IS_BADCH(int s) { return is(s, 62); }
241     public static final boolean APR_STATUS_IS_BADARG(int s) { return is(s, 63); }
242     public static final boolean APR_STATUS_IS_EOF(int s) { return is(s, 64); }
243     public static final boolean APR_STATUS_IS_NOTFOUND(int s) { return is(s, 65); }
244     /* empty slot: +16 */
245     /* empty slot: +17 */
246     /* empty slot: +18 */
247     public static final boolean APR_STATUS_IS_ANONYMOUS(int s) { return is(s, 69); }
248     public static final boolean APR_STATUS_IS_FILEBASED(int s) { return is(s, 70); }
249     public static final boolean APR_STATUS_IS_KEYBASED(int s) { return is(s, 71); }
250     public static final boolean APR_STATUS_IS_EINIT(int s) { return is(s, 72); }
251     public static final boolean APR_STATUS_IS_ENOTIMPL(int s) { return is(s, 73); }
252     public static final boolean APR_STATUS_IS_EMISMATCH(int s) { return is(s, 74); }
253     public static final boolean APR_STATUS_IS_EBUSY(int s) { return is(s, 75); }
254
255     /* Socket errors */
256     public static final boolean APR_STATUS_IS_EAGAIN(int s) { return is(s, 90); }
257     public static final boolean APR_STATUS_IS_ETIMEDOUT(int s) { return is(s, 91); }
258     public static final boolean APR_STATUS_IS_ECONNABORTED(int s) { return is(s, 92); }
259     public static final boolean APR_STATUS_IS_ECONNRESET(int s) { return is(s, 93); }
260     public static final boolean APR_STATUS_IS_EINPROGRESS(int s) { return is(s, 94); }
261     public static final boolean APR_STATUS_IS_EINTR(int s) { return is(s, 95); }
262     public static final boolean APR_STATUS_IS_ENOTSOCK(int s) { return is(s, 96); }
263     public static final boolean APR_STATUS_IS_EINVAL(int s) { return is(s, 97); }
264
265 }
266
Popular Tags