KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > JMRuntimeException


1 /*
2  * @(#)JMRuntimeException.java 4.18 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  * Runtime exceptions emitted by JMX implementations.
13  *
14  * @since 1.5
15  */

16 public class JMRuntimeException extends RuntimeException JavaDoc {
17      
18     /* Serial version */
19     private static final long serialVersionUID = 6573344628407841861L;
20
21     /**
22      * Default constructor.
23      */

24     public JMRuntimeException() {
25     super();
26     }
27     
28     /**
29      * Constructor that allows a specific error message to be specified.
30      *
31      * @param message the detail message.
32      */

33     public JMRuntimeException(String JavaDoc message) {
34     super(message);
35     }
36     
37     /**
38      * Constructor with a nested exception. This constructor is
39      * package-private because it arrived too late for the JMX 1.2
40      * specification. A later version may make it public.
41      */

42     JMRuntimeException(String JavaDoc message, Throwable JavaDoc cause) {
43     super(message);
44
45     /* Make a best effort to set the cause, but if we don't
46        succeed, too bad, you don't get that useful debugging
47        information. We jump through hoops here so that we can
48        work on platforms prior to J2SE 1.4 where the
49        Throwable.initCause method was introduced. If we change
50        the public interface of JMRuntimeException in a future
51        version we can add getCause() so we don't need to do this. */

52     try {
53         java.lang.reflect.Method JavaDoc initCause =
54         Throwable JavaDoc.class.getMethod("initCause",
55                       new Class JavaDoc[] {Throwable JavaDoc.class});
56         initCause.invoke(this, new Object JavaDoc[] {cause});
57     } catch (Exception JavaDoc e) {
58         // OK: just means we won't have debugging info
59
}
60     }
61 }
62
Popular Tags