KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > ReflectionException


1 /*
2  * @(#)ReflectionException.java 4.20 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management;
9
10
11
12 /**
13  * Represents exceptions thrown in the MBean server when using the
14  * java.lang.reflect classes to invoke methods on MBeans. It "wraps" the
15  * actual java.lang.Exception thrown.
16  *
17  * @since 1.5
18  */

19 public class ReflectionException extends JMException JavaDoc {
20
21     /* Serial version */
22     private static final long serialVersionUID = 9170809325636915553L;
23
24     /**
25      * @serial The wrapped {@link Exception}
26      */

27     private java.lang.Exception JavaDoc exception ;
28
29
30     /**
31      * Creates a <CODE>ReflectionException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE>.
32      *
33      * @param e the wrapped exception.
34      */

35     public ReflectionException(java.lang.Exception JavaDoc e) {
36     super() ;
37     exception = e ;
38     }
39
40     /**
41      * Creates a <CODE>ReflectionException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE> with
42      * a detail message.
43      *
44      * @param e the wrapped exception.
45      * @param message the detail message.
46      */

47     public ReflectionException(java.lang.Exception JavaDoc e, String JavaDoc message) {
48     super(message) ;
49     exception = e ;
50     }
51
52     /**
53      * Returns the actual {@link Exception} thrown.
54      *
55      * @return the wrapped {@link Exception}.
56      */

57     public java.lang.Exception JavaDoc getTargetException() {
58     return exception ;
59     }
60
61     /**
62      * Returns the actual {@link Exception} thrown.
63      *
64      * @return the wrapped {@link Exception}.
65      */

66     public Throwable JavaDoc getCause() {
67     return exception;
68     }
69 }
70
Popular Tags