net.sf.xbus.base.core
Class XException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.sf.xbus.base.core.XException
All Implemented Interfaces:
java.io.Serializable

public class XException
extends java.lang.Exception

All errors that occur while processing a request are handled by throwing a XException. Because nearly all methods possibly throw a XException, only a few points (eg. the receivers) have to catch and handle it.

See Also:
Serialized Form

Constructor Summary
XException(java.lang.String location, java.lang.String layer, java.lang.String Package, java.lang.String number)
          Constructs a XException and traces the message and the backtrace.
XException(java.lang.String location, java.lang.String layer, java.lang.String Package, java.lang.String number, java.util.List params)
          Constructs a XException and traces the message and the backtrace.
XException(java.lang.String location, java.lang.String layer, java.lang.String Package, java.lang.String number, java.lang.Throwable t)
          Constructs a XException and traces the Throwable and the backtrace.
XException(java.lang.String location, java.lang.String layer, java.lang.String Package, java.lang.String number, java.lang.Throwable t, java.util.List params)
          Constructs a XException and traces the Throwable and the backtrace.
 
Method Summary
static void clearExceptionInformation()
          Removes information about previous exceptions.
static java.lang.String getExceptionInformation()
           
 java.lang.String getMessage()
           
static void setExceptionInformation(java.lang.String message, java.lang.Throwable t)
          Sets the information for the current XException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

XException

public XException(java.lang.String location,
                  java.lang.String layer,
                  java.lang.String Package,
                  java.lang.String number)
Constructs a XException and traces the message and the backtrace.

Parameters:
location - indicates wether this is an internal or an external problem
layer - indicates the layer where the error has occurred
Package - indicates the package where the error has occurred
number - to identify the error

XException

public XException(java.lang.String location,
                  java.lang.String layer,
                  java.lang.String Package,
                  java.lang.String number,
                  java.util.List params)
Constructs a XException and traces the message and the backtrace.

Parameters:
location - indicates wether this is an internal or an external problem
layer - indicates the layer where the error has occurred
Package - indicates the package where the error has occurred
number - to identify the error
params - a list of values to be included in the message

XException

public XException(java.lang.String location,
                  java.lang.String layer,
                  java.lang.String Package,
                  java.lang.String number,
                  java.lang.Throwable t,
                  java.util.List params)
Constructs a XException and traces the Throwable and the backtrace.

Parameters:
location - indicates wether this is an internal or an external problem
layer - indicates the layer where the error has occurred
Package - indicates the package where the error has occurred
number - to identify the error
t - contains the thrown Exception.
params - list of parameters to be inclueded in the message

XException

public XException(java.lang.String location,
                  java.lang.String layer,
                  java.lang.String Package,
                  java.lang.String number,
                  java.lang.Throwable t)
Constructs a XException and traces the Throwable and the backtrace.

Parameters:
location - indicates wether this is an internal or an external problem
layer - indicates the layer where the error has occurred
Package - indicates the package where the error has occurred
number - to identify the error
t - contains the thrown Exception.
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable
Returns:
the message string of this instance (which may be null).

getExceptionInformation

public static java.lang.String getExceptionInformation()
Returns:
a more detailed information about the last thrown XException.

setExceptionInformation

public static void setExceptionInformation(java.lang.String message,
                                           java.lang.Throwable t)
Sets the information for the current XException

Parameters:
message - the message of this XException
t - the thrown Exception.

clearExceptionInformation

public static void clearExceptionInformation()
Removes information about previous exceptions.