|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.beasys.commerce.foundation.exception.SystemException
The SystemException class is used to signal system-level exceptions
to a caller. It is the base system exception class. A system-level exception
is a severe exception that prevents a thread of execution from proceeding in a
normal manner.
The SystemException class is closely tied to the
MessageCatalog. An SystemException
contains a log and user message that is constructed using the MessageCatalog.
In fact, each SystemException derivative should have at
least one user and log catalog message.
In the case of an EJB, the following guidelines should be followed:
If an enterprise bean method encounters a system-level exception or error that does not allow the method to successfully complete, the method should throw a suitable system exception compatible with the method's throw clause:
RuntimeException or
error, it should simply propagate the error from the bean method to the Container.
SystemException or
derivative that wraps the original exception.
SystemException
or EJBException.
A bean provider is responsible for using the standard EJB system exceptions
(javax.ejb.EJBException and javax.ejb.NoSuchEntityException) where
appropriate.
Since the practice of throwing a RemoteException has been deprecated
in the EJB 1.1 specification, all such occurrences must be replaced with an
instance of SystemException. In the case of a bean method that calls
another bean method, all RemoteExceptions should simply be propagated
from the bean method.
If an EJB method throws a SystemException, any existing
transaction will be rolled back by the Container and the bean's state will
be set to "does not exists".
javax.ejb.EJBException,
MessageCatalog,
MessageCatalogException| Field Summary | |
protected java.util.Stack |
logMessages
The log messages. |
protected java.util.Stack |
userMessages
The user messages. |
| Constructor Summary | |
SystemException()
Constructs an SystemException with no associated message. |
|
SystemException(java.lang.String namespace,
java.lang.String messageKey)
Class constructor taking the namespace and key of the associated catalog message. |
|
SystemException(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. |
|
SystemException(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. |
|
SystemException(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. |
|
SystemException(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. |
|
SystemException(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. |
|
SystemException(SystemException topException,
SystemException bottomException)
Constructs an SystemException from two source SystemExceptions
by concatinating the screen and log messages of the two source SystemExceptions. |
|
| 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. |
| Field Detail |
protected java.util.Stack logMessages
protected java.util.Stack userMessages
| Constructor Detail |
public SystemException()
SystemException with no associated message.
public SystemException(SystemException topException,
SystemException bottomException)
SystemException from two source SystemExceptions
by concatinating the screen and log messages of the two source SystemExceptions.
The messages of the first SystemException will preceed those of the second in the
constructed SystemException. Furthermore, the new SystemException
will have the embedded exception of the first SystemException associated with it.SystemException - topExceptionSystemException - bottomException
public SystemException(java.lang.String namespace,
java.lang.String messageKey)
namespace - The associated catalog message namespace.messageKey - The associated catalog message key.
public SystemException(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 SystemException(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 SystemException(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 SystemException(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 SystemException(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()
public java.lang.String getLocalizedMessage()
public java.lang.String toString()
|
© 2001 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||