|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception com.beasys.commerce.foundation.exception.ApplicationException
@Deprecated public class 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
, DuplicateKeyException
,
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:
EJBContext.setRollbackOnly()
.
setRollbackOnly
at all costs.
If this is not possible, consider using a FatalApplicationException
.
MessageCatalog
,
FatalApplicationException
,
MessageCatalogException
,
Serialized FormField Summary | |
---|---|
protected Exception |
embeddedException
Deprecated The embedded exception. |
protected Stack |
logMessages
Deprecated The log messages. |
protected Stack |
userMessages
Deprecated The user messages. |
Constructor Summary | |
---|---|
ApplicationException()
Deprecated Constructs an ApplicationException with no associated message. |
|
ApplicationException(ApplicationException topException,
ApplicationException bottomException)
Deprecated Constructs an ApplicationException from two source ApplicationException s
by concatinating the screen and log messages of the two source ApplicationException s. |
|
ApplicationException(String namespace,
String messageKey)
Deprecated Class constructor taking the namespace and key of the associated catalog message. |
|
ApplicationException(String namespace,
String messageKey,
Exception exception)
Deprecated Class constructor taking the namespace and key of the associated catalog message and an embedded exception. |
|
ApplicationException(String namespace,
String messageKey,
Object argument)
Deprecated Class constructor taking the namespace and key of the associated catalog message and a message parameter substitution argument. |
|
ApplicationException(String namespace,
String messageKey,
Object[] arguments)
Deprecated Class constructor taking the namespace and key of the associated catalog message and message parameter substitution arguments. |
|
ApplicationException(String namespace,
String messageKey,
Object[] arguments,
Exception exception)
Deprecated Class constructor taking the namespace and key of the associated catalog message, message parameter substitution arguments, and an embedded exception. |
|
ApplicationException(String namespace,
String messageKey,
Object argument,
Exception exception)
Deprecated Class constructor taking the namespace and key of the associated catalog message, message parameter substitution argument, and an embedded exception. |
Method Summary | |
---|---|
void |
addLogMessage(String namespace,
String messageKey)
Deprecated Adds a new log catalog message to the stack of associated messages. |
void |
addLogMessage(String namespace,
String messageKey,
Object argument)
Deprecated Adds a new log catalog message to the stack of associated messages. |
void |
addLogMessage(String namespace,
String messageKey,
Object[] arguments)
Deprecated Adds a new log catalog message to the stack of associated messages. |
void |
addMessage(String namespace,
String messageKey)
Deprecated Adds a new user and log catalog message to the stack of associated messages. |
void |
addMessage(String namespace,
String messageKey,
Object argument)
Deprecated Adds a new user catalog message to the stack of associated messages. |
void |
addMessage(String namespace,
String messageKey,
Object[] arguments)
Deprecated Adds a new user catalog message to the stack of associated messages. |
void |
addUserMessage(String namespace,
String messageKey)
Deprecated Adds a new user catalog message to the stack of associated messages. |
void |
addUserMessage(String namespace,
String messageKey,
Object argument)
Deprecated Adds a new user catalog message to the stack of associated messages. |
void |
addUserMessage(String namespace,
String messageKey,
Object[] arguments)
Deprecated Adds a new user catalog message to the stack of associated messages. |
Exception |
getEmbeddedException()
Deprecated Gets the embedded exception associated with this exception. |
String |
getLocalizedMessage()
Deprecated Returns the user message associated with this exception. |
String |
getLogMessage()
Deprecated Returns the first log catalog message associated with this exception. |
Iterator |
getLogMessages()
Deprecated Returns an iterator over all the log catalog messages associated with this exception. |
String |
getMessage()
Deprecated Returns the user message associated with this exception. |
String |
getUserMessage()
Deprecated Returns the first user catalog message associated with this exception. |
Iterator |
getUserMessages()
Deprecated Returns an iterator over all the user catalog messages associated with this exception. |
String |
toString()
Deprecated Returns a string representation of this exception. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Exception embeddedException
protected Stack logMessages
protected Stack userMessages
Constructor Detail |
---|
public ApplicationException()
ApplicationException
with no associated message.
public ApplicationException(ApplicationException topException, ApplicationException bottomException)
ApplicationException
from two source ApplicationException
s
by concatinating the screen and log messages of the two source ApplicationException
s.
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
- bottomExceptionpublic ApplicationException(String namespace, String messageKey)
namespace
- The associated catalog message namespace.messageKey
- The associated catalog message key.public ApplicationException(String namespace, String messageKey, Exception exception)
namespace
- The associated catalog message namespace.messageKey
- The associated catalog message key.exception
- The embedded exception.public ApplicationException(String namespace, String messageKey, Object argument)
namespace
- The associated catalog message namespace.messageKey
- The associated catalog message key.argument
- The message parameter substitution argument.public ApplicationException(String namespace, String messageKey, Object argument, 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(String namespace, String messageKey, Object[] arguments)
namespace
- The associated catalog message namespace.messageKey
- The associated catalog message key.arguments
- The message parameter substitution arguments.public ApplicationException(String namespace, String messageKey, Object[] arguments, 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 Exception getEmbeddedException()
MessageCatalogException
getEmbeddedException
in interface MessageCatalogException
public String getLogMessage()
MessageCatalogException
getLogMessage
in interface MessageCatalogException
public Iterator getLogMessages()
MessageCatalogException
getLogMessages
in interface MessageCatalogException
public void addLogMessage(String namespace, String messageKey)
MessageCatalogException
addLogMessage
in interface MessageCatalogException
namespace
- Log catalog message namespace.messageKey
- Log catalog message key.public void addLogMessage(String namespace, String messageKey, Object argument)
MessageCatalogException
addLogMessage
in interface MessageCatalogException
namespace
- Log catalog message namespace.messageKey
- Log catalog message key.argument
- Message parameter substitution argument.public void addLogMessage(String namespace, String messageKey, Object[] arguments)
MessageCatalogException
addLogMessage
in interface MessageCatalogException
namespace
- Log catalog message namespace.messageKey
- Log catalog message key.public String getUserMessage()
MessageCatalogException
getUserMessage
in interface MessageCatalogException
public Iterator getUserMessages()
MessageCatalogException
getUserMessages
in interface MessageCatalogException
public void addUserMessage(String namespace, String messageKey)
MessageCatalogException
addUserMessage
in interface MessageCatalogException
namespace
- User catalog message namespace.messageKey
- User catalog message key.public void addUserMessage(String namespace, String messageKey, Object argument)
MessageCatalogException
addUserMessage
in interface MessageCatalogException
namespace
- User catalog message namespace.messageKey
- User catalog message key.argument
- Message parameter substitution argument.public void addUserMessage(String namespace, String messageKey, Object[] arguments)
MessageCatalogException
addUserMessage
in interface MessageCatalogException
namespace
- User catalog message namespace.messageKey
- User catalog message key.public void addMessage(String namespace, String messageKey)
MessageCatalogException
addMessage
in interface MessageCatalogException
namespace
- User and log catalog message namespace.messageKey
- User and log catalog message key.public void addMessage(String namespace, String messageKey, Object argument)
MessageCatalogException
addMessage
in interface MessageCatalogException
namespace
- User and log catalog message namespace.messageKey
- User and log catalog message key.argument
- Message parameter substitution argument.public void addMessage(String namespace, String messageKey, Object[] arguments)
MessageCatalogException
addMessage
in interface MessageCatalogException
namespace
- User and log catalog message namespace.messageKey
- User and log catalog message key.public String getMessage()
getMessage
in class Throwable
public String getLocalizedMessage()
getLocalizedMessage
in class Throwable
public String toString()
toString
in class Throwable
|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |