|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.beasys.commerce.foundation.exception.ApplicationException
The ApplicationException class is used to signal checked business
logic exceptions to a caller. It is the base application exception class.
The ApplicationException class is closely tied to the
MessageCatalog. An ApplicationException
contains a log and user message that is constructed using the MessageCatalog.
In fact, each ApplicationException derivative should have at
least one user and log catalog message.
In the case of an EJB, the following guidelines should be followed:
According to the EJB 1.1 specification, an application exception is an exception
defined in the throws clause of the enterprise bean home and remote interfaces,
other than the RemoteException.
A bean provider is responsible for defining application exceptions in bean
remote and home interfaces and is also responsible for throwing an appropriate
application exception from a bean method to report a business logic exception to
the client. If necessary, the bean provider should subclass the
ApplicationException class to create package-specific application exceptions.
However, a bean provider is responsible for using the standard EJB application
exceptions (CreateException, FinderException,
RemoveException, javax.ejb.DuplicateKeyException,
javax.ejb.ObjectNotFoundException) where appropriate.
Since an application exception does not, and should not, automatically mark the existing transaction (if any) for rollback, the bean provider must do one of the following before throwing the exception, in order to insure data integrity:
javax.ejb.EJBContext#setRollbackOnly.
setRollbackOnly at all costs.
If this is not possible, consider using a FatalApplicationException.
MessageCatalog,
FatalApplicationException,
MessageCatalogException, Serialized Form| Field Summary | |
protected java.lang.Exception |
embeddedException
The embedded exception. |
protected java.util.Stack |
logMessages
The log messages. |
protected java.util.Stack |
userMessages
The user messages. |
| Constructor Summary | |
ApplicationException()
Constructs an ApplicationException with no associated message. |
|
ApplicationException(ApplicationException topException,
ApplicationException bottomException)
Constructs an ApplicationException from two source ApplicationExceptions
by concatinating the screen and log messages of the two source ApplicationExceptions. |
|
ApplicationException(java.lang.String namespace,
java.lang.String messageKey)
Class constructor taking the namespace and key of the associated catalog message. |
|
ApplicationException(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. |
|
ApplicationException(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. |
|
ApplicationException(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. |
|
ApplicationException(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. |
|
ApplicationException(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()
Returns the user message associated with this exception. |
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()
Returns the user message associated with this exception. |
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. |
java.lang.String |
toString()
Returns a string representation of this exception. |
| 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 |
protected java.lang.Exception embeddedException
protected java.util.Stack logMessages
protected java.util.Stack userMessages
| Constructor Detail |
public ApplicationException()
ApplicationException with no associated message.
public ApplicationException(ApplicationException topException,
ApplicationException bottomException)
ApplicationException from two source ApplicationExceptions
by concatinating the screen and log messages of the two source ApplicationExceptions.
The messages of the first ApplicationException will preceed those of the second in the
constructed ApplicationException. Furthermore, the new ApplicationException
will have the embedded exception of the first ApplicationException associated with it.ApplicationException - topExceptionApplicationException - bottomException
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Exception exception)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.exception - The embedded exception.
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object argument)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.argument - The message parameter substitution argument.
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object argument,
java.lang.Exception exception)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.argument - The message parameter substitution argument.exception - The embedded exception.
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object[] arguments)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.arguments - The message parameter substitution arguments.
public ApplicationException(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object[] arguments,
java.lang.Exception exception)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.arguments - The message parameter substitution arguments.exception - The embedded exception.| Method Detail |
public java.lang.Exception getEmbeddedException()
MessageCatalogExceptiongetEmbeddedException in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionpublic java.lang.String getLogMessage()
MessageCatalogExceptiongetLogMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionpublic java.util.Iterator getLogMessages()
MessageCatalogExceptiongetLogMessages in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogException
public void addLogMessage(java.lang.String namespace,
java.lang.String messageKey)
MessageCatalogExceptionaddLogMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - Log catalog message namespace.messageKey - Log catalog message key.
public void addLogMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object argument)
MessageCatalogExceptionaddLogMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - Log catalog message namespace.messageKey - Log catalog message key.argument - Message parameter substitution argument.
public void addLogMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object[] arguments)
MessageCatalogExceptionaddLogMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - Log catalog message namespace.messageKey - Log catalog message key.arguments - Message parameter substitution arguments.public java.lang.String getUserMessage()
MessageCatalogExceptiongetUserMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionpublic java.util.Iterator getUserMessages()
MessageCatalogExceptiongetUserMessages in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogException
public void addUserMessage(java.lang.String namespace,
java.lang.String messageKey)
MessageCatalogExceptionaddUserMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User catalog message namespace.messageKey - User catalog message key.
public void addUserMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object argument)
MessageCatalogExceptionaddUserMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User catalog message namespace.messageKey - User catalog message key.argument - Message parameter substitution argument.
public void addUserMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object[] arguments)
MessageCatalogExceptionaddUserMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User catalog message namespace.messageKey - User catalog message key.arguments - Message parameter substitution arguments.
public void addMessage(java.lang.String namespace,
java.lang.String messageKey)
MessageCatalogExceptionaddMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User and log catalog message namespace.messageKey - User and log catalog message key.
public void addMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object argument)
MessageCatalogExceptionaddMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User and log catalog message namespace.messageKey - User and log catalog message key.argument - Message parameter substitution argument.
public void addMessage(java.lang.String namespace,
java.lang.String messageKey,
java.lang.Object[] arguments)
MessageCatalogExceptionaddMessage in interface MessageCatalogExceptioncom.beasys.commerce.foundation.exception.MessageCatalogExceptionnamespace - User and log catalog message namespace.messageKey - User and log catalog message key.arguments - Message parameter substitution arguments.public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String getLocalizedMessage()
getLocalizedMessage in class java.lang.Throwablepublic java.lang.String toString()
toString in class java.lang.Throwable
|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||