Package javax.jdo

Class JDOException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JDOCanRetryException, JDOFatalException

public class JDOException extends RuntimeException
This is the root of all JDO Exceptions. It contains an optional detail message, an optional nested Throwable array and an optional failed object.
Version:
1.0.2
See Also:
  • Field Details

    • nested

      Throwable[] nested
      This exception was generated because of an exception in the runtime library.
    • failed

      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 Details

    • JDOException

      public JDOException()
      Constructs a new JDOException without a detail message.
    • JDOException

      public JDOException(String msg)
      Constructs a new JDOException with the specified detail message.
      Parameters:
      msg - the detail message.
    • JDOException

      public JDOException(String msg, Throwable[] nested)
      Constructs a new JDOException with the specified detail message and nested Throwables.
      Parameters:
      msg - the detail message.
      nested - the nested Throwable[].
    • JDOException

      public JDOException(String msg, Throwable nested)
      Constructs a new JDOException with the specified detail message and nested Throwable.
      Parameters:
      msg - the detail message.
      nested - the nested Throwable.
    • JDOException

      public JDOException(String msg, Object failed)
      Constructs a new JDOException with 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 new JDOException with the specified detail message, nested Throwables, and failed object.
      Parameters:
      msg - the detail message.
      nested - the nested Throwable[].
      failed - the failed object.
    • JDOException

      public JDOException(String msg, Throwable nested, Object failed)
      Constructs a new JDOException with the specified detail message, nested Throwable, and failed object.
      Parameters:
      msg - the detail message.
      nested - the nested Throwable.
      failed - the failed object.
  • Method Details

    • 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 own Exception.
      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.
      Overrides:
      getCause in class Throwable
      Returns:
      the first or only nested Throwable.
      Since:
      1.0.1
    • 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.
      Overrides:
      initCause in class Throwable
      Parameters:
      cause - ignored.
      Returns:
      never.
    • toString

      public String toString()
      The String representation includes the name of the class, the descriptive comment (if any), the String representation of the failed Object (if any), and the String representation of the nested Throwables (if any).
      Overrides:
      toString in class Throwable
      Returns:
      the String.
    • printStackTrace

      public void printStackTrace()
      Prints this JDOException and its backtrace to the standard error output. Print nested Throwables' stack trace as well.
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream s)
      Prints this JDOException and its backtrace to the specified print stream. Print nested Throwables' stack trace as well.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      s - PrintStream to use for output
    • printStackTrace

      public void printStackTrace(PrintWriter s)
      Prints this JDOException and its backtrace to the specified print writer. Print nested Throwables' stack trace as well.
      Overrides:
      printStackTrace in class Throwable
      Parameters:
      s - PrintWriter to use for output
    • exceptionToString

      private static String exceptionToString(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.