© 2002 BEA Systems, Inc.


com.bea.p13n.exceptions
Class ApplicationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.bea.p13n.exceptions.ApplicationException
Direct Known Subclasses:
AdvisorException, AuthenticationException, ConfigurableEntityCreateException, ContentException, CryptException, DataManagementException, DomException, E2EException, EntityNotFoundException, ExpressionException, GroupAlreadyExistsException, InvalidArgumentException, InvalidGroupnameException, InvalidPasswordException, InvalidSessionStateException, InvalidUsernameException, MailServiceException, PipelineException, PortalException, PrincipalNotExclusivelyManagedByAdminException, ProcessingException, ProfileNotFoundException, PropertySetParseException, PropertyValidationException, RealmNotWritableAddException, RealmNotWritableRemoveException, com.bea.p13n.rules.internal.RuleException, UserAlreadyExistsException

public abstract class ApplicationException
extends java.lang.Exception

An abstract base class designed to be extended by a given subsystem or service. It provides exception-chaining functionality that allows for printing a chained stack trace. The ApplicationException is the superclass of those exceptions created as a result of an application-specific condition that may occur. For example, an application may experience a business logic failure which needs to be communicated back to the caller, and alternative programmatic action may be chosen to compensate for the failure. It is HIGHLY RECOMMENDED that subclasses provide the same constructors that are present in this class in order to maintain the highest degree of compatibility with this API, as well as the version of Throwable forthcoming in JDK 1.4. Although not enforced by this class, it is STRONGLY RECOMMENDED that the message argument set in the constructor originate from the WLS message catalog and not be hard-coded. For example:

public static final MySubsystemExceptionTextFormatter myFormatter = new MySubsystemExceptionTextFormatter(); . . throw new MySubsystemException ( myFormatter.MyExceptionMessage( arg0, arg1) ); Subclasses should contain data attributes pertaining to the failed condition such that a precise, meaningful message can be conveyed to the caller. A good check is to examine the exception message. If the message has placeholders representing application objects, those application objects should probably exist as attributes in the given exception class.

See Also:
Serialized Form

Constructor Summary
ApplicationException()
           
ApplicationException(java.lang.String message)
          Constructor
ApplicationException(java.lang.String message, java.lang.Throwable cause)
          Constructor
ApplicationException(java.lang.Throwable cause)
          Constructor
 
Method Summary
 java.lang.Throwable getCause()
          Returns the embedded, or chained Exception that caused this Exception.
 void printStackTrace()
          Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.
 void printStackTrace(java.io.PrintStream out)
          Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.
 void printStackTrace(java.io.PrintWriter out)
          Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.
 java.lang.String toString()
          Print a string representation of this exception and its embedded exceptions.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationException

public ApplicationException()

ApplicationException

public ApplicationException(java.lang.String message)
Constructor

Parameters:
message - String representing the Exception message

ApplicationException

public ApplicationException(java.lang.String message,
                            java.lang.Throwable cause)
Constructor

Parameters:
message - String representing the exception message
cause - Throwable object representing the caused exception

ApplicationException

public ApplicationException(java.lang.Throwable cause)
Constructor

Parameters:
cause - Throwable object representing the causing exception
Method Detail

getCause

public java.lang.Throwable getCause()
Returns the embedded, or chained Exception that caused this Exception.

Returns:
The Exception object chained to this Exception, or null if one does not exist.

printStackTrace

public void printStackTrace(java.io.PrintStream out)
Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.

Parameters:
out - PrintStream used to output the stack trace
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter out)
Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.

Parameters:
out - PrintWriter used to output the stack trace
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Designed to print the stack trace of this exception, as well as the exception it is chained to, if applicable.

Overrides:
printStackTrace in class java.lang.Throwable

toString

public java.lang.String toString()
Print a string representation of this exception and its embedded exceptions.

Overrides:
toString in class java.lang.Throwable

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved