javax.management
Class MBeanException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.management.JMException
              extended by javax.management.MBeanException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MBeanRegistrationException

public class MBeanException
extends JMException

Represents an arbitrary exception thrown by a management bean. When a management bean executes code that causes an exception to be thrown, the resulting exception is wrapped inside an MBeanException. Calling getTargetException() will return the wrapped exception.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
MBeanException(Exception e)
          Constructs a new MBeanException wrapping the specified exception.
MBeanException(Exception e, String message)
          Constructs a new MBeanException wrapping the specified exception and using the supplied message.
 
Method Summary
 Throwable getCause()
          Returns the true cause of this exception, the wrapped exception.
 Exception getTargetException()
          Returns the true cause of this exception, the wrapped exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MBeanException

public MBeanException(Exception e)
Constructs a new MBeanException wrapping the specified exception.

Parameters:
e - the exception to be wrapped.

MBeanException

public MBeanException(Exception e,
                      String message)
Constructs a new MBeanException wrapping the specified exception and using the supplied message.

Parameters:
e - the exception to be wrapped.
message - the error message to give to the user.
Method Detail

getCause

public Throwable getCause()
Returns the true cause of this exception, the wrapped exception.

Overrides:
getCause in class Throwable
Returns:
the wrapped exception.

getTargetException

public Exception getTargetException()
Returns the true cause of this exception, the wrapped exception.

Returns:
the wrapped exception.