01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package javax.management;
09:
10: /**
11: * Represents runtime exceptions thrown by MBean methods in
12: * the agent. It "wraps" the actual <CODE>java.lang.RuntimeException</CODE> exception thrown.
13: * This exception will be built by the MBeanServer when a call to an
14: * MBean method throws a runtime exception.
15: *
16: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
17: */
18:
19: public class RuntimeMBeanException extends JMRuntimeException {
20:
21: /**
22: * The encapsulated RuntimeException
23: */
24: private java.lang.RuntimeException runtimeException;
25:
26: /**
27: * Creates a <CODE>RuntimeMBeanException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE>.
28: */
29: public RuntimeMBeanException(java.lang.RuntimeException e) {
30: super ();
31: runtimeException = e;
32: }
33:
34: /**
35: * Creates a <CODE>RuntimeMBeanException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE> with
36: * a detailed message.
37: */
38: public RuntimeMBeanException(java.lang.RuntimeException e,
39: String message) {
40: super (message);
41: runtimeException = e;
42: }
43:
44: /**
45: * Returns the actual <CODE>java.lang.RuntimeException</CODE> thrown
46: */
47: public java.lang.RuntimeException getTargetException() {
48: return runtimeException;
49: }
50:
51: }
|