intarsys runtime library

de.intarsys.tools.exception
Class ExceptionTools

java.lang.Object
  extended by de.intarsys.tools.exception.ExceptionTools

public class ExceptionTools
extends Object

Tool class for dealing with Exceptions.


Constructor Summary
ExceptionTools()
           
 
Method Summary
static IOException createIOException(String message, Throwable cause)
           
static void fail()
          Simply fail with a RuntimeException.
static
<T> T
futureSimpleGet(Future<T> future)
           
static
<T extends Number>
T
futureSimpleGetNumber(Future<T> future)
           
static Throwable getInChain(Throwable t, Class<?> clazz)
           
static Throwable getRoot(Throwable t)
          The root cause of t.
static String getStackTraceString(Throwable t)
           
static boolean isInChain(Throwable t, Class<?> clazz)
           
static boolean isKnownReason(Throwable t)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionTools

public ExceptionTools()
Method Detail

createIOException

public static IOException createIOException(String message,
                                            Throwable cause)

fail

public static void fail()
Simply fail with a RuntimeException.


futureSimpleGet

public static <T> T futureSimpleGet(Future<T> future)

futureSimpleGetNumber

public static <T extends Number> T futureSimpleGetNumber(Future<T> future)

getInChain

public static Throwable getInChain(Throwable t,
                                   Class<?> clazz)

getRoot

public static Throwable getRoot(Throwable t)
The root cause of t.

Parameters:
t - A Throwable.
Returns:
The most inner cause of t.

getStackTraceString

public static String getStackTraceString(Throwable t)

isInChain

public static boolean isInChain(Throwable t,
                                Class<?> clazz)

isKnownReason

public static boolean isKnownReason(Throwable t)

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.