javax.jdo
Class JDOException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.jdo.JDOException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JDOCanRetryException, JDOEnhanceException, JDOFatalException

public class JDOException
extends java.lang.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
Author:
Craig Russell
See Also:
Serialized Form

Constructor Summary
JDOException()
          Constructs a new JDOException without a detail message.
JDOException(java.lang.String msg)
          Constructs a new JDOException with the specified detail message.
JDOException(java.lang.String msg, java.lang.Object failed)
          Constructs a new JDOException with the specified detail message and failed object.
JDOException(java.lang.String msg, java.lang.Throwable nested)
          Constructs a new JDOException with the specified detail message and nested Throwable.
JDOException(java.lang.String msg, java.lang.Throwable[] nested)
          Constructs a new JDOException with the specified detail message and nested Throwables.
JDOException(java.lang.String msg, java.lang.Throwable[] nested, java.lang.Object failed)
          Constructs a new JDOException with the specified detail message, nested Throwables, and failed object.
JDOException(java.lang.String msg, java.lang.Throwable nested, java.lang.Object failed)
          Constructs a new JDOException with the specified detail message, nested Throwable, and failed object.
 
Method Summary
 java.lang.Throwable getCause()
          Often there is only one nested exception, and this method returns it.
 java.lang.Object getFailedObject()
          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.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.
 void printStackTrace()
          Prints this JDOException and its backtrace to the standard error output.
 void printStackTrace(java.io.PrintStream s)
          Prints this JDOException and its backtrace to the specified print stream.
 void printStackTrace(java.io.PrintWriter s)
          Prints this JDOException and its backtrace to the specified print writer.
 java.lang.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).
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDOException

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


JDOException

public JDOException(java.lang.String msg)
Constructs a new JDOException with the specified detail message.

Parameters:
msg - the detail message.

JDOException

public JDOException(java.lang.String msg,
                    java.lang.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(java.lang.String msg,
                    java.lang.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(java.lang.String msg,
                    java.lang.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(java.lang.String msg,
                    java.lang.Throwable[] nested,
                    java.lang.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(java.lang.String msg,
                    java.lang.Throwable nested,
                    java.lang.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 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 own Exception.

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:
getCause in class java.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:
initCause in class java.lang.Throwable
Parameters:
cause - ignored.
Returns:
never.

toString

public java.lang.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 java.lang.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 java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Prints this JDOException and its backtrace to the specified print stream. Print nested Throwables' stack trace as well.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - PrintStream to use for output

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Prints this JDOException and its backtrace to the specified print writer. Print nested Throwables' stack trace as well.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - PrintWriter to use for output


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.