com.xavax.xstore.exception
Class PersistenceException

Object
  extended byThrowable
      extended byException
          extended byRuntimeException
              extended byPersistenceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClassNotRegisteredException, ClassNotSupportedException, DatabaseNotRegisteredException, FieldAccessException, InvalidReferenceException, ObjectNotFoundException, PersistenceMetadataException

public class PersistenceException
extends RuntimeException

PersistenceException is the base class for all exceptions thrown by the persistence framework.

See Also:
Serialized Form

Constructor Summary
PersistenceException(PersistenceManager pm, String message, Throwable cause)
          Construct a PersistenceException with the specified message.
PersistenceException(PersistenceManager pm, Throwable cause)
          Construct a PersistenceException with a generic message.
PersistenceException(String message, Throwable cause)
          Construct a PersistenceException with the specified message.
 
Method Summary
 void handle()
          Handle a persistence exception by writing a description of the exception to the log file.
 void header()
          Output the header of an exception description.
 PersistenceManager manager()
          Returns the persistence manager passed to the constructor of this exception.
 String name()
          Returns the class name of this exception.
 void trailer()
          Output the trailer of an exception description.
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistenceException

public PersistenceException(PersistenceManager pm,
                            Throwable cause)
Construct a PersistenceException with a generic message.

Parameters:
pm - the persistence manager.
cause - the cause of this exception, or null.

PersistenceException

public PersistenceException(PersistenceManager pm,
                            String message,
                            Throwable cause)
Construct a PersistenceException with the specified message.

Parameters:
pm - the persistence manager.
message - the message string describing the exception.
cause - the cause of this exception, or null.

PersistenceException

public PersistenceException(String message,
                            Throwable cause)
Construct a PersistenceException with the specified message.

Parameters:
message - the message string describing the exception.
cause - the cause of this exception, or null.
Method Detail

handle

public void handle()
Handle a persistence exception by writing a description of the exception to the log file. Derived classes can override this method to customize the log message.


header

public void header()
Output the header of an exception description. If a persistence manager was specified in the constructor of this exception, the header is written to the log file; otherwise, it is written to the System.err stream.


trailer

public void trailer()
Output the trailer of an exception description. If a persistence manager was specified in the constructor of this exception, the trailer is written to the log file; otherwise, it is written to the System.err stream.


manager

public PersistenceManager manager()
Returns the persistence manager passed to the constructor of this exception.

Returns:
the persistence manager.

name

public String name()
Returns the class name of this exception.

Returns:
the class name of this exception.