|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ptolemy.kernel.util.KernelRuntimeException
public class KernelRuntimeException
Base class for runtime exceptions. This class extends the basic Java RuntimeException with a constructor that can take a Nameable as an argument.
This exception supports all the constructor forms of KernelException, but is implemented as a RuntimeException so that it does not have to be declared.
The cause argument to the constructor is a Throwable that caused the exception. The cause argument is used when code throws an exception and we want to rethrow the exception but print the stacktrace where the first exception occurred. This is called exception chaining.
JDK1.4 and later support exception chaining. We are implementing
a version of exception chaining here ourselves so that we can use JVMs
earlier than JDK1.4. See the KernelException
documentation for differences between our exception chaining
implementation and the JDK1.4 implementation.
Green (cxh) |
Green (cxh) |
Field Summary | |
---|---|
private java.lang.Throwable |
_cause
|
private java.util.Collection |
_causes
|
private java.lang.String |
_message
|
Constructor Summary | |
---|---|
KernelRuntimeException()
Construct an exception with no specific detail message. |
|
KernelRuntimeException(java.util.Collection objects,
java.lang.Throwable cause,
java.lang.String detail)
Construct an exception with a detail message that includes the names of a collection of Nameable objects plus the argument string. |
|
KernelRuntimeException(Nameable object1,
Nameable object2,
java.lang.Throwable cause,
java.lang.String detail)
Construct an exception with a detail message that includes the names of the first two arguments plus the value of the fourth argument string. |
|
KernelRuntimeException(Nameable object,
java.lang.String detail)
Construct an exception with a detail message that includes the name of the first argument and the value of the second argument string. |
|
KernelRuntimeException(java.lang.String detail)
Construct an exception with only a detail message. |
|
KernelRuntimeException(java.lang.Throwable cause,
java.lang.String detail)
Construct an exception with a cause and a detail message. |
Method Summary | |
---|---|
protected void |
_setCause(java.lang.Throwable cause)
Set the cause to the specified throwable. |
protected void |
_setMessage(java.lang.String message)
Sets the error message to the specified string. |
java.lang.Throwable |
getCause()
Get the cause of this exception. |
java.lang.String |
getMessage()
Get the message of this exception. |
java.util.Collection |
getNameables()
Get the first Nameable, if any, that was passed as an argument. |
void |
printStackTrace()
Print a stack trace message to stderr including this exception, its stack trace and if the cause exception is known, print the cause exception and the cause stacktrace. |
void |
printStackTrace(java.io.PrintStream printStream)
Print a stack trace message to printStream including this exception, its stack trace and if the cause exception is known, print the cause exception and the cause stacktrace. |
void |
printStackTrace(java.io.PrintWriter printWriter)
Print a stack trace message to printWriter including this exception, its stack trace and if the cause exception is known, print the cause exception and the cause stacktrace. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.Throwable _cause
private java.util.Collection _causes
private java.lang.String _message
Constructor Detail |
---|
public KernelRuntimeException()
public KernelRuntimeException(java.lang.String detail)
detail
- The message.public KernelRuntimeException(java.lang.Throwable cause, java.lang.String detail)
cause
- The cause of this exception.detail
- The message.public KernelRuntimeException(Nameable object, java.lang.String detail)
object
- The object.detail
- The message.public KernelRuntimeException(Nameable object1, Nameable object2, java.lang.Throwable cause, java.lang.String detail)
object1
- The first object.object2
- The second object.cause
- The cause of this exception.detail
- The message.public KernelRuntimeException(java.util.Collection objects, java.lang.Throwable cause, java.lang.String detail)
objects
- The Collection of Nameable objectscause
- The cause of this exception.detail
- The message.Method Detail |
---|
public java.lang.Throwable getCause()
getCause
in class java.lang.Throwable
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.util.Collection getNameables()
public void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream printStream)
printStackTrace
in class java.lang.Throwable
printStream
- The PrintStream to write to.public void printStackTrace(java.io.PrintWriter printWriter)
printStackTrace
in class java.lang.Throwable
printWriter
- The PrintWriter to write to.protected void _setCause(java.lang.Throwable cause)
cause
- The cause of this exceptionprotected void _setMessage(java.lang.String message)
message
- The message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |