KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > rpc > api > RPCException


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: RPCException.java 869 2006-07-13 12:47:08Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.rpc.api;
27
28 /**
29  * Exception thrown if there is a failure in the response done by the remote
30  * side.
31  * @author Florent Benoit
32  */

33 public class RPCException extends Exception JavaDoc {
34
35     /**
36      * Id for serializable class.
37      */

38     private static final long serialVersionUID = -8386978969361863691L;
39
40     /**
41      * Is that the wrapped Exception is an application exception or not ? (chapter 14.2.1 of EJB 3.0 specification).
42      */

43     private boolean applicationException = false;
44
45
46     /**
47      * Constructs a new runtime exception with <code>null</code> as its detail
48      * message. The cause is not initialized, and may subsequently be
49      * initialized by a call to {@link #initCause}.
50      */

51     public RPCException() {
52         super();
53     }
54
55     /**
56      * Constructs a new runtime exception with the specified detail message. The
57      * cause is not initialized, and may subsequently be initialized by a call
58      * to {@link #initCause}.
59      * @param message the detail message. The detail message is saved for later
60      * retrieval by the {@link #getMessage()} method.
61      */

62     public RPCException(final String JavaDoc message) {
63         super(message);
64     }
65
66     /**
67      * Constructs a new runtime exception with the specified detail message and
68      * cause.
69      * <p>
70      * Note that the detail message associated with <code>cause</code> is
71      * <i>not</i> automatically incorporated in this runtime exception's detail
72      * message.
73      * @param message the detail message (which is saved for later retrieval by
74      * the {@link #getMessage()} method).
75      * @param cause the cause (which is saved for later retrieval by the
76      * {@link #getCause()} method). (A <tt>null</tt> value is
77      * permitted, and indicates that the cause is nonexistent or
78      * unknown.)
79      */

80     public RPCException(final String JavaDoc message, final Throwable JavaDoc cause) {
81         super(message, cause);
82     }
83
84     /**
85      * Constructs a new exception with the specified cause and a detail message
86      * of <tt>(cause==null ? null : cause.toString())</tt> (which typically
87      * contains the class and detail message of <tt>cause</tt>). This
88      * constructor is useful for exceptions that are little more than wrappers
89      * for other throwables (for example, {@link
90      * java.security.PrivilegedActionException}).
91      * @param cause the cause (which is saved for later retrieval by the
92      * {@link #getCause()} method). (A <tt>null</tt> value is
93      * permitted, and indicates that the cause is nonexistent or
94      * unknown.)
95      * @since 1.4
96      */

97     public RPCException(final Throwable JavaDoc cause) {
98         super(cause);
99     }
100
101     /**
102      * @return true if the wrapped exception is an application exception
103      */

104     public boolean isApplicationException() {
105         return applicationException;
106     }
107
108     /**
109      * Mark this exception as an application exception (wrapped exception).
110      */

111     public void setApplicationException() {
112         this.applicationException = true;
113     }
114 }
115
Popular Tags