org.openejb
Class OpenEJBException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.openejb.OpenEJBException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ApplicationException, SystemException

public class OpenEJBException
extends java.lang.Exception

The OpenEJBException is the standard exception thrown by all methods in all type in the Container Provider Interface (CPI). The OpenEJBException has 3 subtypes each serving a different purpose. The CPI will always thrown one of these subtype and never the OpenEJBException itself.

Version:
$Revision: 1.2 $ $Date: 2002/02/25 20:30:57 $
See Also:
ApplicationException, InvalidateReferenceException, OpenEJBException, SystemException, Serialized Form

Constructor Summary
OpenEJBException()
           Default constructor, which simply delegates exception handling up the inheritance chain to Exception.
OpenEJBException(java.lang.String message)
           This constructor allows a message to be supplied indicating the source of the problem that occurred.
OpenEJBException(java.lang.String message, java.lang.Object arg1)
           This constructor allows a message to be supplied indicating the source of the problem that occurred.
OpenEJBException(java.lang.String message, java.lang.Object[] args)
           This constructor allows a message to be supplied indicating the source of the problem that occurred.
OpenEJBException(java.lang.String message, java.lang.Object arg1, java.lang.Object arg2)
           This constructor allows a message to be supplied indicating the source of the problem that occurred.
OpenEJBException(java.lang.String message, java.lang.Throwable rootCause)
          This constructor allows both a message identifying the problem that occurred as well as a "root cause" exception to be supplied, which may later be used by the wrapping application.
OpenEJBException(java.lang.Throwable rootCause)
           This constructor allows a "root cause" exception to be supplied, which may later be used by the wrapping application.
 
Method Summary
 java.lang.String getMessage()
           This returns the message for the Exception.
 java.lang.Throwable getRootCause()
           This will return the root cause Throwable, or null if one does not exist.
 void printStackTrace()
           This prints the stack trace of the Exception.
 void printStackTrace(java.io.PrintStream stream)
           This prints the stack trace of the Exception.
 void printStackTrace(java.io.PrintWriter writer)
           This prints the stack trace of the Exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenEJBException

public OpenEJBException()

Default constructor, which simply delegates exception handling up the inheritance chain to Exception.


OpenEJBException

public OpenEJBException(java.lang.String message)

This constructor allows a message to be supplied indicating the source of the problem that occurred.

Parameters:
message - String identifying the cause of the problem.

OpenEJBException

public OpenEJBException(java.lang.Throwable rootCause)

This constructor allows a "root cause" exception to be supplied, which may later be used by the wrapping application.

Parameters:
rootCause - Throwable that triggered the problem.

OpenEJBException

public OpenEJBException(java.lang.String message,
                        java.lang.Throwable rootCause)
This constructor allows both a message identifying the problem that occurred as well as a "root cause" exception to be supplied, which may later be used by the wrapping application.
Parameters:
message - String identifying the cause of the problem.
rootCause - Throwable that triggered this problem.

OpenEJBException

public OpenEJBException(java.lang.String message,
                        java.lang.Object arg1)

This constructor allows a message to be supplied indicating the source of the problem that occurred. It also allows an argument to be supplied as an argument to the Messages class in the determination of the error message to delegate up the inheritance chain.

Parameters:
message - String identifying the cause of the problem.
arg1 - Object argument for messaging use.

OpenEJBException

public OpenEJBException(java.lang.String message,
                        java.lang.Object arg1,
                        java.lang.Object arg2)

This constructor allows a message to be supplied indicating the source of the problem that occurred. It also allows two arguments to be supplied as arguments to the Messages class in the determination of the error message to delegate up the inheritance chain.

This is purely a convenience form for OpenEJBException(String, Object[]).

Parameters:
message - String identifying the cause of the problem.
args - Object[] argument for messaging use.

OpenEJBException

public OpenEJBException(java.lang.String message,
                        java.lang.Object[] args)

This constructor allows a message to be supplied indicating the source of the problem that occurred. It also allows an array of arguments to be supplied as arguments to the Messages class in the determination of the error message to delegate up the inheritance chain.

Parameters:
message - String identifying the cause of the problem.
args - Object[] argument for messaging use.
Method Detail

getMessage

public java.lang.String getMessage()

This returns the message for the Exception. If there is a root cause, the message associated with the root cause is appended.

Overrides:
getMessage in class java.lang.Throwable
Returns:
String - message for this Exception.

printStackTrace

public void printStackTrace()

This prints the stack trace of the Exception. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream stream)

This prints the stack trace of the Exception. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
stream - PrintStream to print stack trace to.

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)

This prints the stack trace of the Exception. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
writer - PrintWriter to print stack trace to.

getRootCause

public java.lang.Throwable getRootCause()

This will return the root cause Throwable, or null if one does not exist.

Returns:
Throwable - the wrapped Throwable.