Package javax.jdo
Class JDOException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.jdo.JDOException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
JDOCanRetryException,JDOFatalException
public class JDOException extends java.lang.RuntimeExceptionThis is the root of all JDO Exceptions. It contains an optional detail message, an optional nestedThrowablearray and an optional failed object.- Version:
- 1.0.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.ObjectfailedThis exception may be the result of incorrect parameters supplied to an API.private booleaninPrintStackTraceFlag indicating whether printStackTrace is being executed.private static I18NHelpermsgThe Internationalization message helper.(package private) java.lang.Throwable[]nestedThis exception was generated because of an exception in the runtime library.
-
Constructor Summary
Constructors Constructor Description JDOException()Constructs a newJDOExceptionwithout a detail message.JDOException(java.lang.String msg)Constructs a newJDOExceptionwith the specified detail message.JDOException(java.lang.String msg, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message and failed object.JDOException(java.lang.String msg, java.lang.Throwable nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowable.JDOException(java.lang.String msg, java.lang.Throwable[] nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowables.JDOException(java.lang.String msg, java.lang.Throwable[] nested, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowables, and failed object.JDOException(java.lang.String msg, java.lang.Throwable nested, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowable, and failed object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringexceptionToString(java.lang.Exception ex)Helper method returning a short description of the exception passed as an argument.java.lang.ThrowablegetCause()Often there is only one nested exception, and this method returns it.java.lang.ObjectgetFailedObject()The exception may include a failed object.java.lang.Throwable[]getNestedExceptions()The exception may have been caused by multiple exceptions in the runtime.java.lang.ThrowableinitCause(java.lang.Throwable cause)JDK 1.4 includes a new chaining mechanism for Throwable, but since JDO has its own "legacy" chaining mechanism, the "standard" mechanism cannot be used.voidprintStackTrace()Prints thisJDOExceptionand its backtrace to the standard error output.voidprintStackTrace(java.io.PrintStream s)Prints thisJDOExceptionand its backtrace to the specified print stream.voidprintStackTrace(java.io.PrintWriter s)Prints thisJDOExceptionand its backtrace to the specified print writer.java.lang.StringtoString()TheStringrepresentation includes the name of the class, the descriptive comment (if any), theStringrepresentation of the failedObject(if any), and theStringrepresentation of the nestedThrowables (if any).
-
-
-
Field Detail
-
nested
java.lang.Throwable[] nested
This exception was generated because of an exception in the runtime library.
-
failed
java.lang.Object failed
This exception may be the result of incorrect parameters supplied to an API. This is the object from which the user can determine the cause of the problem.
-
msg
private static I18NHelper msg
The Internationalization message helper.
-
inPrintStackTrace
private boolean inPrintStackTrace
Flag indicating whether printStackTrace is being executed.
-
-
Constructor Detail
-
JDOException
public JDOException()
Constructs a newJDOExceptionwithout a detail message.
-
JDOException
public JDOException(java.lang.String msg)
Constructs a newJDOExceptionwith the specified detail message.- Parameters:
msg- the detail message.
-
JDOException
public JDOException(java.lang.String msg, java.lang.Throwable[] nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowables.- Parameters:
msg- the detail message.nested- the nestedThrowable[].
-
JDOException
public JDOException(java.lang.String msg, java.lang.Throwable nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowable.- Parameters:
msg- the detail message.nested- the nestedThrowable.
-
JDOException
public JDOException(java.lang.String msg, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message and failed object.- Parameters:
msg- the detail message.failed- the failed object.
-
JDOException
public JDOException(java.lang.String msg, java.lang.Throwable[] nested, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowables, and failed object.- Parameters:
msg- the detail message.nested- the nestedThrowable[].failed- the failed object.
-
JDOException
public JDOException(java.lang.String msg, java.lang.Throwable nested, java.lang.Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowable, and failed object.- Parameters:
msg- the detail message.nested- the nestedThrowable.failed- the failed object.
-
-
Method Detail
-
getFailedObject
public java.lang.Object getFailedObject()
The exception may include a failed object.- Returns:
- the failed object.
-
getNestedExceptions
public java.lang.Throwable[] getNestedExceptions()
The exception may have been caused by multiple exceptions in the runtime. If multiple objects caused the problem, each failed object will have its ownException.- Returns:
- the nested Throwable array.
-
getCause
public java.lang.Throwable getCause()
Often there is only one nested exception, and this method returns it. If there are more than one, then this method returns the first nested exception. If there is no nested exception, then null is returned.- Overrides:
getCausein classjava.lang.Throwable- Returns:
- the first or only nested Throwable.
- Since:
- 1.0.1
-
initCause
public java.lang.Throwable initCause(java.lang.Throwable cause)
JDK 1.4 includes a new chaining mechanism for Throwable, but since JDO has its own "legacy" chaining mechanism, the "standard" mechanism cannot be used. This method always throws a JDOFatalInternalException.- Overrides:
initCausein classjava.lang.Throwable- Parameters:
cause- ignored.- Returns:
- never.
-
toString
public java.lang.String toString()
TheStringrepresentation includes the name of the class, the descriptive comment (if any), theStringrepresentation of the failedObject(if any), and theStringrepresentation of the nestedThrowables (if any).- Overrides:
toStringin classjava.lang.Throwable- Returns:
- the
String.
-
printStackTrace
public void printStackTrace()
Prints thisJDOExceptionand its backtrace to the standard error output. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints thisJDOExceptionand its backtrace to the specified print stream. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
Prints thisJDOExceptionand its backtrace to the specified print writer. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s-PrintWriterto use for output
-
exceptionToString
private static java.lang.String exceptionToString(java.lang.Exception ex)
Helper method returning a short description of the exception passed as an argument. The returned string has the format defined by Throwable.toString. If the exception has a non-null detail message string, then it returns the name of exception class concatenated with ": " concatenated with the detailed message. Otherwise it returns the name of exception class.- Parameters:
ex- the exception to be represented.- Returns:
- a string representation of the exception passed as an argument.
-
-