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 "user defined" exceptions thrown by MBean methods
12: * in the agent. It "wraps" the actual "user defined" exception thrown.
13: * This exception will be built by the MBeanServer when a call to an
14: * MBean method results in an unknown exception.
15: *
16: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
17: */
18:
19: public class MBeanException extends JMException {
20:
21: /**
22: * Encapsulated Exception
23: */
24: private java.lang.Exception exception;
25:
26: /**
27: * Creates an <CODE>MBeanException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE>.
28: */
29: public MBeanException(java.lang.Exception e) {
30: super ();
31: exception = e;
32: }
33:
34: /**
35: * Creates an <CODE>MBeanException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE> with
36: * a detail message.
37: */
38: public MBeanException(java.lang.Exception e, String message) {
39: super (message);
40: exception = e;
41: }
42:
43: /**
44: * Returns the actual <CODE>java.lang.Exception</CODE> thrown.
45: */
46: public java.lang.Exception getTargetException() {
47: return exception;
48: }
49:
50: }
|