KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > RuntimeErrorException


1 /*
2  * @(#)RuntimeErrorException.java 4.19 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  * When a <CODE>java.lang.Error</CODE> occurs in the agent it should be caught and
14  * re-thrown as a <CODE>RuntimeErrorException</CODE>.
15  *
16  * @since 1.5
17  */

18 public class RuntimeErrorException extends JMRuntimeException JavaDoc {
19     
20     /* Serial version */
21     private static final long serialVersionUID = 704338937753949796L;
22
23     /**
24      * @serial The encapsulated {@link Error}
25      */

26     private java.lang.Error JavaDoc error ;
27
28     /**
29      * Default constructor.
30      *
31      * @param e the wrapped error.
32      */

33     public RuntimeErrorException(java.lang.Error JavaDoc e) {
34       super();
35       error = e ;
36     }
37     
38     /**
39      * Constructor that allows a specific error message to be specified.
40      *
41      * @param e the wrapped error.
42      * @param message the detail message.
43      */

44     public RuntimeErrorException(java.lang.Error JavaDoc e, String JavaDoc message) {
45        super(message);
46        error = e ;
47     }
48     
49     /**
50      * Returns the actual {@link Error} thrown.
51      *
52      * @return the wrapped {@link Error}.
53      */

54     public java.lang.Error JavaDoc getTargetError() {
55     return error ;
56     }
57
58     /**
59      * Returns the actual {@link Error} thrown.
60      *
61      * @return the wrapped {@link Error}.
62      */

63     public Throwable JavaDoc getCause() {
64     return error;
65     }
66 }
67
Popular Tags