org.openorb.util
Class ExceptionTool

java.lang.Object
  |
  +--org.openorb.util.ExceptionTool

public final class ExceptionTool
extends java.lang.Object

A utility class for optionaly attaching causal objects to exceptions if the exception implementation supports initCause

Author:
Richard G Clark

Method Summary
static java.lang.Error initCause(java.lang.Error e, java.lang.Throwable cause)
          Attaches the cause to the exception if this operation is supported by the current environment.
static java.lang.RuntimeException initCause(java.lang.RuntimeException e, java.lang.Throwable cause)
          Attaches the cause to the exception if this operation is supported by the current environment.
static SystemException initCause(SystemException e, java.lang.Throwable cause)
          Attaches the cause to the exception if this operation is supported by the current environment.
static java.lang.Throwable initCause(java.lang.Throwable e, java.lang.Throwable cause)
          Attaches the cause to the exception if this operation is supported by the current environment.
static UserException initCause(UserException e, java.lang.Throwable cause)
          Attaches the cause to the exception if this operation is supported by the current environment.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initCause

public static SystemException initCause(SystemException e,
                                        java.lang.Throwable cause)
Attaches the cause to the exception if this operation is supported by the current environment.
Parameters:
e - the exception to attach the cause to
cause - the cause of this specified exception
Returns:
the parameter e

initCause

public static UserException initCause(UserException e,
                                      java.lang.Throwable cause)
Attaches the cause to the exception if this operation is supported by the current environment.
Parameters:
e - the exception to attach the cause to
cause - the cause of this specified exception
Returns:
the parameter e

initCause

public static java.lang.Throwable initCause(java.lang.Throwable e,
                                            java.lang.Throwable cause)
Attaches the cause to the exception if this operation is supported by the current environment.
Parameters:
e - the exception to attach the cause to
cause - the cause of this specified exception
Returns:
the parameter e

initCause

public static java.lang.RuntimeException initCause(java.lang.RuntimeException e,
                                                   java.lang.Throwable cause)
Attaches the cause to the exception if this operation is supported by the current environment.
Parameters:
e - the exception to attach the cause to
cause - the cause of this specified exception
Returns:
the parameter e

initCause

public static java.lang.Error initCause(java.lang.Error e,
                                        java.lang.Throwable cause)
Attaches the cause to the exception if this operation is supported by the current environment.
Parameters:
e - the exception to attach the cause to
cause - the cause of this specified exception
Returns:
the parameter e