BEA Systems, Inc.

com.beasys.commerce.foundation.exception
Class FatalApplicationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.beasys.commerce.foundation.exception.FatalApplicationException

public class FatalApplicationException
extends java.lang.RuntimeException
implements MessageCatalogException

The FatalApplicationException class is used to signal fatal business logic exceptions to a caller. Like the ApplicationException class, the FatalApplicationException class is used to signal business logic exceptions. However, unlike the ApplicationException class, if a bean method throws a FatalApplicationException, any existing transaction will be rolledback by the Container and the bean's state will be set to "does not exists". The net effect is the same as if the bean method threw a SystemException.

The FatalApplicationException class is closely tied to the MessageCatalog. An FatalApplicationException contains a log and user message that is constructed using the MessageCatalog. In fact, each FatalApplicationException derivative should have at least one user and log catalog message.

See Also:
MessageCatalog, ApplicationException, MessageCatalogException, Serialized Form

Field Summary
protected  java.lang.Exception embeddedException
           
protected  java.util.Stack logMessages
           
protected  java.util.Stack userMessages
           
 
Constructor Summary
FatalApplicationException()
          Constructs an FatalApplicationException with no associated message.
FatalApplicationException(FatalApplicationException topException, FatalApplicationException bottomException)
          Constructs an FatalApplicationException from two source FatalApplicationExceptions by concatinating the screen and log messages of the two source FatalApplicationExceptions.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey)
          Class constructor taking the namespace and key of the associated catalog message.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey, java.lang.Exception exception)
          Class constructor taking the namespace and key of the associated catalog message and an embedded exception.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey, java.lang.Object argument)
          Class constructor taking the namespace and key of the associated catalog message and a message parameter substitution argument.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey, java.lang.Object[] arguments)
          Class constructor taking the namespace and key of the associated catalog message and message parameter substitution arguments.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey, java.lang.Object[] arguments, java.lang.Exception exception)
          Class constructor taking the namespace and key of the associated catalog message, message parameter substitution arguments, and an embedded exception.
FatalApplicationException(java.lang.String namespace, java.lang.String messageKey, java.lang.Object argument, java.lang.Exception exception)
          Class constructor taking the namespace and key of the associated catalog message, message parameter substitution argument, and an embedded exception.
 
Method Summary
 void addLogMessage(java.lang.String namespace, java.lang.String messageKey)
          Adds a new log catalog message to the stack of associated messages.
 void addLogMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object argument)
          Adds a new log catalog message to the stack of associated messages.
 void addLogMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object[] arguments)
          Adds a new log catalog message to the stack of associated messages.
 void addMessage(java.lang.String namespace, java.lang.String messageKey)
          Adds a new user and log catalog message to the stack of associated messages.
 void addMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object argument)
          Adds a new user catalog message to the stack of associated messages.
 void addMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object[] arguments)
          Adds a new user catalog message to the stack of associated messages.
 void addUserMessage(java.lang.String namespace, java.lang.String messageKey)
          Adds a new user catalog message to the stack of associated messages.
 void addUserMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object argument)
          Adds a new user catalog message to the stack of associated messages.
 void addUserMessage(java.lang.String namespace, java.lang.String messageKey, java.lang.Object[] arguments)
          Adds a new user catalog message to the stack of associated messages.
 java.lang.Exception getEmbeddedException()
          Gets the embedded exception associated with this exception.
 java.lang.String getLocalizedMessage()
           
 java.lang.String getLogMessage()
          Returns the first log catalog message associated with this exception.
 java.util.Iterator getLogMessages()
          Returns an iterator over all the log catalog messages associated with this exception.
 java.lang.String getMessage()
           
 java.lang.String getUserMessage()
          Returns the first user catalog message associated with this exception.
 java.util.Iterator getUserMessages()
          Returns an iterator over all the user catalog messages associated with this exception.
static void main(java.lang.String[] args)
          FatalApplicationException UT entry point.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

embeddedException

protected java.lang.Exception embeddedException

logMessages

protected java.util.Stack logMessages

userMessages

protected java.util.Stack userMessages
Constructor Detail

FatalApplicationException

public FatalApplicationException()
Constructs an FatalApplicationException with no associated message.

FatalApplicationException

public FatalApplicationException(FatalApplicationException topException,
                                 FatalApplicationException bottomException)
Constructs an FatalApplicationException from two source FatalApplicationExceptions by concatinating the screen and log messages of the two source FatalApplicationExceptions. The messages of the first FatalApplicationException will preceed those of the second in the constructed FatalApplicationException. Furthermore, the new FatalApplicationException will have the embedded exception of the first FatalApplicationException associated with it.
Parameters:
FatalApplicationException - topException
FatalApplicationException - bottomException

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey)
Class constructor taking the namespace and key of the associated catalog message.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey,
                                 java.lang.Exception exception)
Class constructor taking the namespace and key of the associated catalog message and an embedded exception.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.
exception - The embedded exception.

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey,
                                 java.lang.Object argument)
Class constructor taking the namespace and key of the associated catalog message and a message parameter substitution argument.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.
argument - The message parameter substitution argument.

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey,
                                 java.lang.Object argument,
                                 java.lang.Exception exception)
Class constructor taking the namespace and key of the associated catalog message, message parameter substitution argument, and an embedded exception.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.
argument - The message parameter substitution argument.
exception - The embedded exception.

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey,
                                 java.lang.Object[] arguments)
Class constructor taking the namespace and key of the associated catalog message and message parameter substitution arguments.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.
arguments - The message parameter substitution arguments.

FatalApplicationException

public FatalApplicationException(java.lang.String namespace,
                                 java.lang.String messageKey,
                                 java.lang.Object[] arguments,
                                 java.lang.Exception exception)
Class constructor taking the namespace and key of the associated catalog message, message parameter substitution arguments, and an embedded exception.
Parameters:
namespace - The associated catalog message namespace.
messageKey - The associated catalog message key.
arguments - The message parameter substitution arguments.
exception - The embedded exception.
Method Detail

getEmbeddedException

public java.lang.Exception getEmbeddedException()
Description copied from interface: MessageCatalogException
Gets the embedded exception associated with this exception.
Specified by:
getEmbeddedException in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Returns:
The embedded exception.

getLogMessage

public java.lang.String getLogMessage()
Description copied from interface: MessageCatalogException
Returns the first log catalog message associated with this exception.
Specified by:
getLogMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Returns:
The first log catalog message associated with this exception.

getLogMessages

public java.util.Iterator getLogMessages()
Description copied from interface: MessageCatalogException
Returns an iterator over all the log catalog messages associated with this exception.
Specified by:
getLogMessages in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Returns:
An iterator over all log catalog messages.

addLogMessage

public void addLogMessage(java.lang.String namespace,
                          java.lang.String messageKey)
Description copied from interface: MessageCatalogException
Adds a new log catalog message to the stack of associated messages.
Specified by:
addLogMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - Log catalog message namespace.
messageKey - Log catalog message key.

addLogMessage

public void addLogMessage(java.lang.String namespace,
                          java.lang.String messageKey,
                          java.lang.Object argument)
Description copied from interface: MessageCatalogException
Adds a new log catalog message to the stack of associated messages.
Specified by:
addLogMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - Log catalog message namespace.
messageKey - Log catalog message key.
argument - Message parameter substitution argument.

addLogMessage

public void addLogMessage(java.lang.String namespace,
                          java.lang.String messageKey,
                          java.lang.Object[] arguments)
Description copied from interface: MessageCatalogException
Adds a new log catalog message to the stack of associated messages.
Specified by:
addLogMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - Log catalog message namespace.
messageKey - Log catalog message key.
arguments - Message parameter substitution arguments.

getUserMessage

public java.lang.String getUserMessage()
Description copied from interface: MessageCatalogException
Returns the first user catalog message associated with this exception.
Specified by:
getUserMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Returns:
The user catalog message associated with this exception.

getUserMessages

public java.util.Iterator getUserMessages()
Description copied from interface: MessageCatalogException
Returns an iterator over all the user catalog messages associated with this exception.
Specified by:
getUserMessages in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Returns:
An iterator over all user catalog messages.

addUserMessage

public void addUserMessage(java.lang.String namespace,
                           java.lang.String messageKey)
Description copied from interface: MessageCatalogException
Adds a new user catalog message to the stack of associated messages.
Specified by:
addUserMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User catalog message namespace.
messageKey - User catalog message key.

addUserMessage

public void addUserMessage(java.lang.String namespace,
                           java.lang.String messageKey,
                           java.lang.Object argument)
Description copied from interface: MessageCatalogException
Adds a new user catalog message to the stack of associated messages.
Specified by:
addUserMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User catalog message namespace.
messageKey - User catalog message key.
argument - Message parameter substitution argument.

addUserMessage

public void addUserMessage(java.lang.String namespace,
                           java.lang.String messageKey,
                           java.lang.Object[] arguments)
Description copied from interface: MessageCatalogException
Adds a new user catalog message to the stack of associated messages.
Specified by:
addUserMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User catalog message namespace.
messageKey - User catalog message key.
arguments - Message parameter substitution arguments.

addMessage

public void addMessage(java.lang.String namespace,
                       java.lang.String messageKey)
Description copied from interface: MessageCatalogException
Adds a new user and log catalog message to the stack of associated messages.
Specified by:
addMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User and log catalog message namespace.
messageKey - User and log catalog message key.

addMessage

public void addMessage(java.lang.String namespace,
                       java.lang.String messageKey,
                       java.lang.Object argument)
Description copied from interface: MessageCatalogException
Adds a new user catalog message to the stack of associated messages.
Specified by:
addMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User and log catalog message namespace.
messageKey - User and log catalog message key.
argument - Message parameter substitution argument.

addMessage

public void addMessage(java.lang.String namespace,
                       java.lang.String messageKey,
                       java.lang.Object[] arguments)
Description copied from interface: MessageCatalogException
Adds a new user catalog message to the stack of associated messages.
Specified by:
addMessage in interface MessageCatalogException
Tags copied from interface: MessageCatalogException
Parameters:
namespace - User and log catalog message namespace.
messageKey - User and log catalog message key.
arguments - Message parameter substitution arguments.

getMessage

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

getLocalizedMessage

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

toString

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

main

public static void main(java.lang.String[] args)
FatalApplicationException UT entry point.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved