KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > interop > SystemException


1 /**
2  *
3  * Copyright 2004-2005 The Apache Software Foundation
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  *
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.interop;
19
20 /*
21  * This class is used to help marshall server side exceptions back to the client.
22  * A server exception is caught and then set as a cause of the system exception.
23  *
24  * Originally there were two different implementations of the this cause, one for
25  * JDK 1.3 (which didn't have the cause object on an Exception) and this one for JDK 1.4
26  * The JDK 1.3 class has been removed.
27  *
28  * In the stubs/skeletons, they check to see if the marshalled exception is an instance of
29  * SystemException and then it take appropriate actions.
30  *
31  * Its possible that this could change to use the JDK 1.4 RuntimeException. This may
32  * cause some troubles with identification of specific server side exceptions vs. a
33  * general runtime exception.
34  *
35  * For now, I am going to leave this class in place. A future TODO would be to investigate
36  * this situation more carefully.
37  */

38
39 public class SystemException extends RuntimeException JavaDoc {
40     public SystemException(String JavaDoc message) {
41         super(message);
42     }
43
44     public SystemException(Throwable JavaDoc cause) {
45         super(cause != null && cause instanceof SystemException
46               && cause.getMessage() == null
47               ? cause.getCause() : cause);
48     }
49
50     public SystemException(String JavaDoc message, Throwable JavaDoc cause) {
51         super(message, cause != null && cause instanceof SystemException
52                        && cause.getMessage() == null
53                        ? cause.getCause() : cause);
54     }
55 }
56
Popular Tags