KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > RuntimeMBeanException


1 /*
2  * @(#)RuntimeMBeanException.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  * Represents runtime exceptions thrown by MBean methods in
13  * the agent. It "wraps" the actual <CODE>java.lang.RuntimeException</CODE> exception thrown.
14  * This exception will be built by the MBeanServer when a call to an
15  * MBean method throws a runtime exception.
16  *
17  * @since 1.5
18  */

19 public class RuntimeMBeanException extends JMRuntimeException JavaDoc {
20     
21     /* Serial version */
22     private static final long serialVersionUID = 5274912751982730171L;
23
24     /**
25      * @serial The encapsulated {@link RuntimeException}
26      */

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

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

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

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

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