/* * @(#)ReflectionException.java 4.20 03/12/19 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package javax.management; /** * Represents exceptions thrown in the MBean server when using the * java.lang.reflect classes to invoke methods on MBeans. It "wraps" the * actual java.lang.Exception thrown. * * @since 1.5 */ public class ReflectionException extends JMException { /* Serial version */ private static final long serialVersionUID = 9170809325636915553L; /** * @serial The wrapped {@link Exception} */ private java.lang.Exception exception ; /** * Creates a ReflectionException that wraps the actual java.lang.Exception. * * @param e the wrapped exception. */ public ReflectionException(java.lang.Exception e) { super() ; exception = e ; } /** * Creates a ReflectionException that wraps the actual java.lang.Exception with * a detail message. * * @param e the wrapped exception. * @param message the detail message. */ public ReflectionException(java.lang.Exception e, String message) { super(message) ; exception = e ; } /** * Returns the actual {@link Exception} thrown. * * @return the wrapped {@link Exception}. */ public java.lang.Exception getTargetException() { return exception ; } /** * Returns the actual {@link Exception} thrown. * * @return the wrapped {@link Exception}. */ public Throwable getCause() { return exception; } }