Package javax.jdo
Class JDOException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.jdo.JDOException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JDOCanRetryException,JDOEnhanceException,JDOFatalException
public class JDOException extends RuntimeException
This 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
- Author:
- Craig Russell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JDOException()Constructs a newJDOExceptionwithout a detail message.JDOException(String msg)Constructs a newJDOExceptionwith the specified detail message.JDOException(String msg, Object failed)Constructs a newJDOExceptionwith the specified detail message and failed object.JDOException(String msg, Throwable nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowable.JDOException(String msg, Throwable[] nested)Constructs a newJDOExceptionwith the specified detail message and nestedThrowables.JDOException(String msg, Throwable[] nested, Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowables, and failed object.JDOException(String msg, Throwable nested, Object failed)Constructs a newJDOExceptionwith the specified detail message, nestedThrowable, and failed object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowablegetCause()Often there is only one nested exception, and this method returns it.ObjectgetFailedObject()The exception may include a failed object.Throwable[]getNestedExceptions()The exception may have been caused by multiple exceptions in the runtime.ThrowableinitCause(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(PrintStream s)Prints thisJDOExceptionand its backtrace to the specified print stream.voidprintStackTrace(PrintWriter s)Prints thisJDOExceptionand its backtrace to the specified print writer.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).-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTrace
-
-
-
-
Constructor Detail
-
JDOException
public JDOException()
Constructs a newJDOExceptionwithout a detail message.
-
JDOException
public JDOException(String msg)
Constructs a newJDOExceptionwith the specified detail message.- Parameters:
msg- the detail message.
-
JDOException
public JDOException(String msg, Throwable[] nested)
Constructs a newJDOExceptionwith the specified detail message and nestedThrowables.- Parameters:
msg- the detail message.nested- the nestedThrowable[].
-
JDOException
public JDOException(String msg, Throwable nested)
Constructs a newJDOExceptionwith the specified detail message and nestedThrowable.- Parameters:
msg- the detail message.nested- the nestedThrowable.
-
JDOException
public JDOException(String msg, Object failed)
Constructs a newJDOExceptionwith the specified detail message and failed object.- Parameters:
msg- the detail message.failed- the failed object.
-
JDOException
public JDOException(String msg, Throwable[] nested, 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.
-
-
Method Detail
-
getFailedObject
public Object getFailedObject()
The exception may include a failed object.- Returns:
- the failed object.
-
getNestedExceptions
public 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 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.
-
initCause
public Throwable initCause(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.
-
toString
public 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).
-
printStackTrace
public void printStackTrace()
Prints thisJDOExceptionand its backtrace to the standard error output. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
Prints thisJDOExceptionand its backtrace to the specified print stream. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
public void printStackTrace(PrintWriter s)
Prints thisJDOExceptionand its backtrace to the specified print writer. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintWriterto use for output
-
-