EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.exceptions
Class EclipseLinkException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.eclipse.persistence.exceptions.EclipseLinkException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CommunicationException, ConcurrencyException, ConversionException, DatabaseException, DBWSException, DynamicException, EntityManagerSetupException, JAXBException, JPQLException, OptimisticLockException, PersistenceUnitLoadingException, RemoteCommandManagerException, SDOException, SessionLoaderException, StaticWeaveException, TransactionException, ValidationException, XMLConversionException, XMLParseException, XMLPlatformException

public abstract class EclipseLinkException
extends java.lang.RuntimeException

Purpose: Any exception raised by EclipseLink should be a subclass of this exception class.

See Also:
Serialized Form

Field Summary
protected static java.lang.String CR
           
protected  int errorCode
           
protected  boolean hasBeenLogged
           
protected  java.lang.String indentationString
           
protected  java.lang.Throwable internalException
           
protected  org.eclipse.persistence.internal.sessions.AbstractSession session
           
protected static java.lang.Boolean shouldPrintInternalException
           
 
Constructor Summary
EclipseLinkException()
          INTERNAL: Return a new exception.
EclipseLinkException(java.lang.String theMessage)
          INTERNAL: EclipseLink exception should only be thrown by EclipseLink.
EclipseLinkException(java.lang.String message, java.lang.Throwable internalException)
          INTERNAL: EclipseLink exception should only be thrown by EclipseLink.
 
Method Summary
protected static java.lang.String cr()
          INTERNAL: Convenience method - return a platform-specific line-feed.
 int getErrorCode()
          PUBLIC: Return the exception error code.
 java.lang.String getIndentationString()
          INTERNAL: Used to print things nicely in the testing tool.
 java.lang.Throwable getInternalException()
          PUBLIC: Return the internal native exception.
 java.lang.String getMessage()
          PUBLIC: Return the exception error message.
 org.eclipse.persistence.internal.sessions.AbstractSession getSession()
          PUBLIC: Return the session.
 boolean hasBeenLogged()
          INTERNAL: Return if this exception has been logged to avoid being logged more than once.
 void printStackTrace()
          PUBLIC: Print both the normal and internal stack traces.
 void printStackTrace(java.io.PrintStream outStream)
          PUBLIC: Print both the normal and internal stack traces.
 void printStackTrace(java.io.PrintWriter writer)
          PUBLIC: Print both the normal and internal stack traces.
 void setErrorCode(int errorCode)
          INTERNAL:
 void setHasBeenLogged(boolean logged)
          INTERNAL: Set this flag to avoid logging an exception more than once.
 void setIndentationString(java.lang.String indentationString)
          INTERNAL: Used to print things nicely in the testing tool.
 void setInternalException(java.lang.Throwable exception)
          INTERNAL: Used to specify the internal exception.
 void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL:
static void setShouldPrintInternalException(boolean printException)
          PUBLIC: Allows overriding of EclipseLink's exception chaining detection.
static boolean shouldPrintInternalException()
          INTERNAL Check to see if the EclipseLink-stored internal exception should be printed in this a EclipseLinkException's stack trace.
 java.lang.String toString()
          INTERNAL:
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

session

protected transient org.eclipse.persistence.internal.sessions.AbstractSession session

internalException

protected java.lang.Throwable internalException

shouldPrintInternalException

protected static java.lang.Boolean shouldPrintInternalException

indentationString

protected java.lang.String indentationString

errorCode

protected int errorCode

CR

protected static final java.lang.String CR

hasBeenLogged

protected boolean hasBeenLogged
Constructor Detail

EclipseLinkException

public EclipseLinkException()
INTERNAL: Return a new exception.


EclipseLinkException

public EclipseLinkException(java.lang.String theMessage)
INTERNAL: EclipseLink exception should only be thrown by EclipseLink.


EclipseLinkException

public EclipseLinkException(java.lang.String message,
                            java.lang.Throwable internalException)
INTERNAL: EclipseLink exception should only be thrown by EclipseLink.

Method Detail

cr

protected static java.lang.String cr()
INTERNAL: Convenience method - return a platform-specific line-feed.


getErrorCode

public int getErrorCode()
PUBLIC: Return the exception error code.


getIndentationString

public java.lang.String getIndentationString()
INTERNAL: Used to print things nicely in the testing tool.


getInternalException

public java.lang.Throwable getInternalException()
PUBLIC: Return the internal native exception. EclipseLink frequently catches Java exceptions and wraps them in its own exception classes to provide more information. The internal exception can still be accessed if required.


getMessage

public java.lang.String getMessage()
PUBLIC: Return the exception error message. EclipseLink error messages are multi-line so that detail descriptions of the exception are given.

Overrides:
getMessage in class java.lang.Throwable

getSession

public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
PUBLIC: Return the session.


hasBeenLogged

public boolean hasBeenLogged()
INTERNAL: Return if this exception has been logged to avoid being logged more than once.


printStackTrace

public void printStackTrace()
PUBLIC: Print both the normal and internal stack traces.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream outStream)
PUBLIC: Print both the normal and internal stack traces.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)
PUBLIC: Print both the normal and internal stack traces.

Overrides:
printStackTrace in class java.lang.Throwable

setErrorCode

public void setErrorCode(int errorCode)
INTERNAL:


setHasBeenLogged

public void setHasBeenLogged(boolean logged)
INTERNAL: Set this flag to avoid logging an exception more than once.


setIndentationString

public void setIndentationString(java.lang.String indentationString)
INTERNAL: Used to print things nicely in the testing tool.


setInternalException

public void setInternalException(java.lang.Throwable exception)
INTERNAL: Used to specify the internal exception.


setSession

public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:


setShouldPrintInternalException

public static void setShouldPrintInternalException(boolean printException)
PUBLIC: Allows overriding of EclipseLink's exception chaining detection.

Parameters:
booleam - printException - If printException is true, the EclipseLink-stored Internal exception will be included in a stack trace or in the exception message of a EclipseLinkException. If printException is false, the EclipseLink-stored Internal Exception will not be included in the stack trace or the exception message of EclipseLinkExceptions

shouldPrintInternalException

public static boolean shouldPrintInternalException()
INTERNAL Check to see if the EclipseLink-stored internal exception should be printed in this a EclipseLinkException's stack trace. This method will check the static ShouldPrintInternalException variable and if it is not set, estimate based on the JDK version used.


toString

public java.lang.String toString()
INTERNAL:

Overrides:
toString in class java.lang.Throwable

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference