atg.core.exception
Class ContainerException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by atg.core.exception.ContainerException
All Implemented Interfaces:
ContainableException, java.io.Serializable
Direct Known Subclasses:
AddException, AgentAuditLoggingException, AgentException, C2CSessionException, CommandInvocationException, CommerceException, DetailedRemoveException, DirectoryModificationException, EvaluationException, FilterException, GetException, IdGeneratorException, InvoiceException, LockManagerException, MappingException, MarkerException, MatchException, MaxNumberItemsException, PipelineManagerException, ProcessException, RemoveException, RepositoryException, SecurityException, TemplateEmailException, TransactionDemarcationException, UpdateException, WebAppRegistryException, WorkflowException

public class ContainerException
extends java.lang.Exception
implements ContainableException

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:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
ContainerException()
          Constructs a new ContainerException.
ContainerException(java.lang.String pStr)
          Constructs a new ContainerException with the given explanation.
ContainerException(java.lang.String pStr, java.lang.Throwable pSourceException)
          Constructs a new ContainerException with the given explanation.
ContainerException(java.lang.Throwable pSourceException)
          Constructs a new ContainerException.
 
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 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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ContainerException

public ContainerException()
Constructs a new ContainerException.


ContainerException

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


ContainerException

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

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

ContainerException

public ContainerException(java.lang.String pStr,
                          java.lang.Throwable pSourceException)
Constructs a new ContainerException 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 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