Path: blob/master/src/java.management/share/classes/javax/management/MBeanException.java
41155 views
/*1* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.management;262728/**29* Represents "user defined" exceptions thrown by MBean methods30* in the agent. It "wraps" the actual "user defined" exception thrown.31* This exception will be built by the MBeanServer when a call to an32* MBean method results in an unknown exception.33*34* @since 1.535*/36public class MBeanException extends JMException {373839/* Serial version */40private static final long serialVersionUID = 4066342430588744142L;4142/**43* @serial Encapsulated {@link Exception}44*/45private java.lang.Exception exception ;464748/**49* Creates an <CODE>MBeanException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE>.50*51* @param e the wrapped exception.52*/53public MBeanException(java.lang.Exception e) {54super() ;55exception = e ;56}5758/**59* Creates an <CODE>MBeanException</CODE> that wraps the actual <CODE>java.lang.Exception</CODE> with60* a detail message.61*62* @param e the wrapped exception.63* @param message the detail message.64*/65public MBeanException(java.lang.Exception e, String message) {66super(message) ;67exception = e ;68}697071/**72* Return the actual {@link Exception} thrown.73*74* @return the wrapped exception.75*/76public Exception getTargetException() {77return exception;78}7980/**81* Return the actual {@link Exception} thrown.82*83* @return the wrapped exception.84*/85public Throwable getCause() {86return exception;87}88}899091