Arch4J 1.1

org.arch4j.core
Class BaseApplicationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.arch4j.core.BaseApplicationException
All Implemented Interfaces:
BaseException, Serializable
Direct Known Subclasses:
DataAccessException, DataNotFoundException, DomainValidationException, FormatException, PersistenceException, RecordDataInputException, StateMachineException, XMLException

public class BaseApplicationException
extends Exception
implements BaseException

This class is the root of the Arch4J exception tree for exceptions that are to be treated as application exceptions. Application exceptions thrown should be handled by business logic.

Additionally, in an EJB (Enterprise Java Beans) context, an application exception will not automatically force the EJB container to roll back a transaction. It is up to the intervening business layers to decide that.

This class is similar to a RemoteException, in that it can hold a nested, wrapped exception.

Version:
1.0
Author:
Russ Brown, Ross E. Greinke
See Also:
Serialized Form

Field Summary
protected  Throwable nestedException
          The nested, wrapped exception.
 
Constructor Summary
BaseApplicationException()
          Constructs a BaseApplicationException with no specified detail message or nested exception.
BaseApplicationException(String message)
          Constructs a BaseApplicationException with the specified detail message.
BaseApplicationException(String message, Throwable exception)
          Constructs a BaseApplicationException with the specified detail message and nested exception.
BaseApplicationException(Throwable exception)
          Constructs a BaseApplicationException with the specified nested exception.
 
Method Summary
 String getMessage()
          Returns the detail message, including the message from the nested exception if there is one.
 Throwable getNestedException()
           
 String getStackTraceString()
           
 void printStackTrace()
          Prints the composite message to System.err.
 void printStackTrace(PrintStream ps)
          Prints the composite message and the embedded stack trace to the specified stream.
 void printStackTrace(PrintWriter pw)
          Prints the composite message and the embedded stack trace to the specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nestedException

protected Throwable nestedException
The nested, wrapped exception.

Constructor Detail

BaseApplicationException

public BaseApplicationException()
Constructs a BaseApplicationException with no specified detail message or nested exception.


BaseApplicationException

public BaseApplicationException(String message)
Constructs a BaseApplicationException with the specified detail message.

Parameters:
message - The detailed message.

BaseApplicationException

public BaseApplicationException(Throwable exception)
Constructs a BaseApplicationException with the specified nested exception.

Parameters:
exception - The nested exception.

BaseApplicationException

public BaseApplicationException(String message,
                                Throwable exception)
Constructs a BaseApplicationException with the specified detail message and nested exception.

Parameters:
message - The detailed message.
exception - The nested exception.
Method Detail

getMessage

public String getMessage()
Returns the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable

printStackTrace

public void printStackTrace(PrintStream ps)
Prints the composite message and the embedded stack trace to the specified stream.

Overrides:
printStackTrace in class Throwable
Parameters:
ps - The print stream.

printStackTrace

public void printStackTrace()
Prints the composite message to System.err.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter pw)
Prints the composite message and the embedded stack trace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
pw - The print writer.

getNestedException

public Throwable getNestedException()
Specified by:
getNestedException in interface BaseException
Returns:
A nested, wrapped exception.

getStackTraceString

public String getStackTraceString()
Specified by:
getStackTraceString in interface BaseException
Returns:
The stack backtrace as a String.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.