com.wm.app.tn.err
Class WrappedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.wm.util.LocalizedException
              extended by com.wm.util.ServerException
                  extended by com.wm.app.b2b.server.ServiceException
                      extended by com.wm.app.tn.err.WrappedException
All Implemented Interfaces:
com.wm.util.SpecifiedLocale, java.io.Serializable
Direct Known Subclasses:
BizDocTypeException, BizDocTypeRegException, DatastoreException, DeliveryException, ProfileStoreException, RestrictedFeatureException, RoutingException, ScheduledArchivalException, StaleRuleListException, TPAStoreException

public class WrappedException
extends com.wm.app.b2b.server.ServiceException

An exception that wraps other exceptions. It maintains an internal list of wrapped exceptions, and allows you to iterate over them. Smart enough to "unwrap" SQLExceptions, and handy for not losing error information. The iteration functionality is NOT thread-safe.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.wm.util.ServerException
ALARM, QUIET
 
Fields inherited from interface com.wm.util.SpecifiedLocale
NULL_LOCALE
 
Constructor Summary
WrappedException()
          Create a WrappedException (starts with no wrapped exceptions)
WrappedException(java.lang.String msg)
          Create a WrappedException with the supplied message (starts with no wrapped exception)
 
Method Summary
 void addException(java.lang.Exception e)
          Add an exception to the list of wrapped exceptions (If the supplied exception is a java.sql.SQLException, all its chained exceptions will be unwrapped and added to the list of wrapped exceptions)
 void addExceptions(java.util.Enumeration e)
          Adds a number of exceptions to the list of wrapped exceptions
 java.lang.Exception firstException()
           
 java.lang.String getMessage()
           
 java.lang.Exception nextException()
           
 void printStackTrace()
          Print the stack trace of this exception (including all wrapped exceptions) to System.err
 void printStackTrace(java.io.PrintStream p)
          Print the stack trace of this exception (including all wrapped exceptions) to the supplied PrintStream
 void printStackTrace(java.io.PrintWriter p)
          Print the stack trace of this exception (including all wrapped exceptions) to the supplied PrintWriter
 
Methods inherited from class com.wm.util.ServerException
getSeverity, setSeverity
 
Methods inherited from class com.wm.util.LocalizedException
getErrorDetails, getInfo, getLocalizedMessage, getLocalizedMessage, getMsgId, getMsgOnly, getMsgOnly, getWrappedException, setErrorDetails
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedException

public WrappedException()
Create a WrappedException (starts with no wrapped exceptions)


WrappedException

public WrappedException(java.lang.String msg)
Create a WrappedException with the supplied message (starts with no wrapped exception)

Method Detail

addException

public void addException(java.lang.Exception e)
Add an exception to the list of wrapped exceptions (If the supplied exception is a java.sql.SQLException, all its chained exceptions will be unwrapped and added to the list of wrapped exceptions)


addExceptions

public void addExceptions(java.util.Enumeration e)
Adds a number of exceptions to the list of wrapped exceptions


firstException

public java.lang.Exception firstException()
Returns:
the first exception in the list of wrapped exceptions (null if there are none)

nextException

public java.lang.Exception nextException()
Returns:
the next exception in the list of wrapped exceptions (null if there are no more)

printStackTrace

public void printStackTrace()
Print the stack trace of this exception (including all wrapped exceptions) to System.err

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream p)
Print the stack trace of this exception (including all wrapped exceptions) to the supplied PrintStream

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter p)
Print the stack trace of this exception (including all wrapped exceptions) to the supplied PrintWriter

Overrides:
printStackTrace in class java.lang.Throwable

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class com.wm.util.ServerException
Returns:
the message of this exception, which includes the messages of all wrapped exceptions