com.glaivestone.javax.util
Class PropagatedException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.glaivestone.javax.util.PropagatedException
All Implemented Interfaces:
java.io.Serializable

public class PropagatedException
extends java.lang.RuntimeException

An unchecked exception that is used to propagate an underlying exception into a containing context. Used to circumvent the constraints of checked exception declarations when cooperating parties need to get through without changing the static declarations.

Implementation Notes

This class was introduced on J2SE 1.3, prior to the introduction in J2SE 1.4 of the "chained exceptions" capability wherein the fundamental Exception class adds an instance variable for recording an underlying cause (originating exception) for any exception.

This class conforms to the J2SE 1.4 accessing protocol getCause and provides equivalent stack trace printing behavior.

Author:
Deb Lewis
See Also:
Serialized Form

Constructor Summary
PropagatedException(java.lang.Throwable cause)
          Constructs a PropagatedException which wraps the underlying cause of the problem.
PropagatedException(java.lang.Throwable cause, java.lang.String message)
          Constructs a PropagatedException which wraps the underlying cause of the problem.
 
Method Summary
 java.lang.Throwable getCause()
          Answer the exception that was originally thrown to cause the exception condition.
 void printStackTrace()
          Prints the stack trace of the exception and its underlying cause to the standard error stream.
 void printStackTrace(java.io.PrintStream ps)
          Prints the stack trace of the exception and its underlying cause to the specified print stream.
 void printStackTrace(java.io.PrintWriter pw)
          Prints the stack trace of the exception and its underlying cause to the specified print writer.
 java.lang.String toString()
          Answer a short description of the receiver.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropagatedException

public PropagatedException(java.lang.Throwable cause)
Constructs a PropagatedException which wraps the underlying cause of the problem.


PropagatedException

public PropagatedException(java.lang.Throwable cause,
                           java.lang.String message)
Constructs a PropagatedException which wraps the underlying cause of the problem.

Method Detail

getCause

public java.lang.Throwable getCause()
Answer the exception that was originally thrown to cause the exception condition.

Overrides:
getCause in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Prints the stack trace of the exception and its underlying cause to the standard error stream.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Prints the stack trace of the exception and its underlying cause to the specified print stream.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Prints the stack trace of the exception and its underlying cause to the specified print writer.

Overrides:
printStackTrace in class java.lang.Throwable

toString

public java.lang.String toString()
Answer a short description of the receiver.

Overrides:
toString in class java.lang.Throwable

GFL 1.1 API