javax.management

Class ReflectionException

public class ReflectionException extends JMException

Represents one of the reflection exceptions thrown by a management bean. When a management bean tries to perform a lookup using the reflection API and encounters an exception, it gets wrapped inside an {@link ReflectionException}. Calling {@link getTargetException()} will return the wrapped exception.

Since: 1.5

Constructor Summary
ReflectionException(Exception e)
Constructs a new ReflectionException wrapping the specified exception.
ReflectionException(Exception e, String message)
Constructs a new ReflectionException wrapping the specified exception and using the supplied message.
Method Summary
ThrowablegetCause()
Returns the true cause of this exception, the wrapped exception.
ExceptiongetTargetException()
Returns the true cause of this exception, the wrapped exception.

Constructor Detail

ReflectionException

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

Parameters: e the exception to be wrapped.

ReflectionException

public ReflectionException(Exception e, String message)
Constructs a new ReflectionException 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.

Returns: the wrapped exception.

getTargetException

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

Returns: the wrapped exception.