org.jboss.mx.util
Class JMXExceptionDecoder

java.lang.Object
  extended byorg.jboss.mx.util.JMXExceptionDecoder

public class JMXExceptionDecoder
extends java.lang.Object

A simple helper to rethrow and/or decode those pesky JMX exceptions.


Constructor Summary
JMXExceptionDecoder()
           
 
Method Summary
static java.lang.Throwable decode(java.lang.Throwable t)
          Attempt to decode the given Throwable.
static java.lang.Throwable decodeToJMXException(java.lang.Throwable ex)
          Unwrap a possibly nested jmx exception down to the last JMException || JMRuntimeException.
static void rethrow(java.lang.Exception e)
          Decode and rethrow the given Throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXExceptionDecoder

public JMXExceptionDecoder()
Method Detail

decode

public static java.lang.Throwable decode(java.lang.Throwable t)
Attempt to decode the given Throwable. If it is a container JMX exception, then the target is returned. Otherwise the argument is returned.


decodeToJMXException

public static java.lang.Throwable decodeToJMXException(java.lang.Throwable ex)
Unwrap a possibly nested jmx exception down to the last JMException || JMRuntimeException.

Parameters:
ex - the exception to unwrap
Returns:
A JMException || JMRuntimeException if ex was of this type, or ex if it was not.

rethrow

public static void rethrow(java.lang.Exception e)
                    throws java.lang.Exception
Decode and rethrow the given Throwable. If it is a container JMX exception, then the target is thrown. Otherwise the argument is thrown.

Throws:
java.lang.Exception