com.reuters.rc.db
Class DbBaseException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.reuters.rc.db.DbBaseException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DbBusinessException, DbSystemException

public class DbBaseException
extends java.lang.Exception

The DbBaseException class is used across all core services. It allows you to set a message with an exception, much like the normal java.lang.Exception class but in addition you can also carry along an original exception if you want. This is incorportated in the output from getMessage and toString(). The previous version of this class used to check if the string passed in was part of the MessageCatalog and if so, then use the associated key in creating the exception message. Various constructors were also provided to do string replacement on the exception message. This functionality is now removed. It is the responsibility of the creator of the exception to lookup message text directly from the MessageCatalog and pass it to the constructor of the exception. Implementation inspired from various placed, most recently Javaworld, Javatips #91. Java 1.4 now has this functionality.

Version:
@VSS_FLAG_VERSION@
Author:
Mark Pollack
See Also:
Serialized Form

Constructor Summary
DbBaseException()
          Do nothing constructor.
DbBaseException(java.lang.String message)
          Creates a new DbBaseException instance with a given message string.
DbBaseException(java.lang.String message, java.lang.Object[] inserts, java.lang.Throwable rootCause)
          Create a new DbBaseException instance.
DbBaseException(java.lang.String message, java.lang.Object insert, java.lang.Throwable rootCause)
          Create a new DbBaseException instance.
DbBaseException(java.lang.String message, java.lang.Throwable rootCause)
          Create a new DbBaseException instance.
DbBaseException(java.lang.Throwable rootCause)
          Create an exception nesting the rootCause of this exception.
 
Method Summary
static java.lang.String generateStackTraceString(java.lang.Throwable t)
           
 java.lang.String getMessage()
          Override Exceptin.getMessage to include information of the root causeo of the exception.
 java.lang.Throwable getRootCause()
          Get the exception that caused this exception to be raised.
 java.lang.String getStackTraceString()
          Return the stack trace including root cause exceptions.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream inPrintStream)
           
 void printStackTrace(java.io.PrintWriter inPrintWriter)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbBaseException

public DbBaseException()
Do nothing constructor.

DbBaseException

public DbBaseException(java.lang.String message)
Creates a new DbBaseException instance with a given message string.
Parameters:
message - a String value

DbBaseException

public DbBaseException(java.lang.Throwable rootCause)
Create an exception nesting the rootCause of this exception.
Parameters:
rootCause - a value of type 'Throwable'.

DbBaseException

public DbBaseException(java.lang.String message,
                       java.lang.Throwable rootCause)
Create a new DbBaseException instance. Allows for an association of an originating exception.
Parameters:
message - Message to describe the exception
rootCause - The exceptio that caused this exception to be raised.

DbBaseException

public DbBaseException(java.lang.String message,
                       java.lang.Object[] inserts,
                       java.lang.Throwable rootCause)
Create a new DbBaseException instance. Allows for an association of an originating exception.
Parameters:
message - Message to describe the exception
inserts - an Object[] value
rootCause - The exceptio that caused this exception to be raised.

DbBaseException

public DbBaseException(java.lang.String message,
                       java.lang.Object insert,
                       java.lang.Throwable rootCause)
Create a new DbBaseException instance. Allows for an association of an originating exception.
Parameters:
message - Message to describe the exception
insert - an Object value
rootCause - The exceptio that caused this exception to be raised.
Method Detail

getRootCause

public java.lang.Throwable getRootCause()
Get the exception that caused this exception to be raised.
Returns:
the root exception.

getStackTraceString

public java.lang.String getStackTraceString()
Return the stack trace including root cause exceptions.
Returns:
The stack trace of the exception.

getMessage

public java.lang.String getMessage()
Override Exceptin.getMessage to include information of the root causeo of the exception.
Overrides:
getMessage in class java.lang.Throwable
Returns:
The exception message, including root cause messages.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream inPrintStream)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter inPrintWriter)
Overrides:
printStackTrace in class java.lang.Throwable

generateStackTraceString

public static java.lang.String generateStackTraceString(java.lang.Throwable t)


Copyright © 2002-2003 Reuters. All Rights Reserved.