atg.svc.exception
Class SvcException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.servlet.jsp.JspException
              extended by atg.svc.exception.SvcException
All Implemented Interfaces:
atg.core.exception.ContainableException, java.io.Serializable
Direct Known Subclasses:
DuplicateRecordException, ObjectException, SolutionFieldStorageException

public class SvcException
extends javax.servlet.jsp.JspException
implements atg.core.exception.ContainableException

Base error class for all ATG Service exceptions. Extends JspException so it will be handled by the JSP engine if thrown that far. Implements ContainableException interface. An exception which contains a source exception. The printStackTrace and toString methods are overridden to display this exception's information and the original source exception. This exception functionality is useful in case you need to "transform" the source exception into a new type. Without this typically developers would use the toString value of the source exception to form the message of the new exception. This process would loose the original stack trace. This allows the original exception's stack trace to be preserved.

See Also:
ContainerException, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
SvcException()
          Constructs a new SvcException.
SvcException(java.lang.String pStr)
          Constructs a new SvcException with the given explanation.
SvcException(java.lang.String pStr, java.lang.Throwable pSourceException)
          Constructs a new SvcException with the given explanation.
SvcException(java.lang.Throwable pSourceException)
          Constructs a new SvcException.
 
Method Summary
 java.lang.Throwable getSourceException()
          Returns property SourceException
 void printStackTrace(boolean pDisplaySource)
          Print our stack trace and optionally that of the source exception if there is one.
 void printStackTrace(java.io.PrintStream pStream, boolean pDisplaySource)
          Print our stack trace and optionally that of the source exception if there is one.
 void printStackTrace(java.io.PrintWriter pWriter)
          Print our stack trace and that of the source exception if there is one.
 void printStackTrace(java.io.PrintWriter pWriter, boolean pDisplaySource)
          Print our stack trace and optionally that of the source exception if there is one.
 void setSourceException(java.lang.Throwable pSourceException)
          Sets property SourceException
 java.lang.String toString()
          Display information about this exception and that of the source exception if there is one.
 java.lang.String toString(boolean pDisplaySource)
          Display information about this exception and optionally that of the source exception if there is one.
 
Methods inherited from class javax.servlet.jsp.JspException
getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

SvcException

public SvcException()
Constructs a new SvcException.


SvcException

public SvcException(java.lang.String pStr)
Constructs a new SvcException with the given explanation.


SvcException

public SvcException(java.lang.Throwable pSourceException)
Constructs a new SvcException.

Parameters:
pSourceException - the initial exception which was the root cause of the problem

SvcException

public SvcException(java.lang.String pStr,
                    java.lang.Throwable pSourceException)
Constructs a new SvcException with the given explanation.

Parameters:
pSourceException - the initial exception which was the root cause of the problem
Method Detail

setSourceException

public void setSourceException(java.lang.Throwable pSourceException)
Sets property SourceException


getSourceException

public java.lang.Throwable getSourceException()
Returns property SourceException

Specified by:
getSourceException in interface atg.core.exception.ContainableException
Returns:
the initial exception which was the root cause of the problem

printStackTrace

public void printStackTrace(boolean pDisplaySource)
Print our stack trace and optionally that of the source exception if there is one. Print to the standard error stream.

Parameters:
pDisplaySource - if true display the source exception info too

printStackTrace

public void printStackTrace(java.io.PrintStream pStream,
                            boolean pDisplaySource)
Print our stack trace and optionally that of the source exception if there is one. Print to the supplied stream.

Parameters:
pStream - Stream to print to
pDisplaySource - if true display the source exception info too

printStackTrace

public void printStackTrace(java.io.PrintWriter pWriter)
Print our stack trace and that of the source exception if there is one. Print to the supplied writer.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
pWriter - writer to print to

printStackTrace

public void printStackTrace(java.io.PrintWriter pWriter,
                            boolean pDisplaySource)
Print our stack trace and optionally that of the source exception if there is one. Print to the supplied writer

Parameters:
pWriter - Writer to print to
pDisplaySource - if true display the source exception info too

toString

public java.lang.String toString()
Display information about this exception and that of the source exception if there is one.

Overrides:
toString in class java.lang.Throwable

toString

public java.lang.String toString(boolean pDisplaySource)
Display information about this exception and optionally that of the source exception if there is one.

Parameters:
pDisplaySource - if true display the source exception info