Methods Summary |
---|
protected static java.lang.String | cr()INTERNAL:
Convenience method - return a platform-specific line-feed.
return oracle.toplink.essentials.internal.helper.Helper.cr();
|
public int | getErrorCode()PUBLIC:
Return the exception error code.
return errorCode;
|
public java.lang.String | getIndentationString()INTERNAL:
Used to print things nicely in the testing tool.
return indentationString;
|
public java.lang.Throwable | getInternalException()PUBLIC:
Return the internal native exception.
TopLink 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.
return internalException;
|
public java.lang.String | getMessage()PUBLIC:
Return the exception error message.
TopLink error messages are multi-line so that detail descriptions of the exception are given.
StringWriter writer = new StringWriter(100);
// Avoid printing internal exception error message twice.
if ((getInternalException() == null) || (!super.getMessage().equals(getInternalException().toString()))) {
writer.write(cr());
writer.write(getIndentationString());
writer.write(ExceptionMessageGenerator.getHeader("DescriptionHeader"));
writer.write(super.getMessage());
}
if (getInternalException() != null) {
writer.write(cr());
writer.write(getIndentationString());
writer.write(ExceptionMessageGenerator.getHeader("InternalExceptionHeader"));
writer.write(getInternalException().toString());
if ((getInternalException() instanceof java.lang.reflect.InvocationTargetException) && ((((java.lang.reflect.InvocationTargetException)getInternalException()).getTargetException()) != null)) {
writer.write(cr());
writer.write(getIndentationString());
writer.write(ExceptionMessageGenerator.getHeader("TargetInvocationExceptionHeader"));
writer.write(((java.lang.reflect.InvocationTargetException)getInternalException()).getTargetException().toString());
}
}
return writer.toString();
|
public oracle.toplink.essentials.internal.sessions.AbstractSession | getSession()PUBLIC:
Return the session.
return session;
|
public boolean | hasBeenLogged()INTERNAL:
Return if this exception has been logged to avoid being logged more than once.
return hasBeenLogged;
|
public void | printStackTrace()PUBLIC:
Print both the normal and internal stack traces.
printStackTrace(System.err);
|
public void | printStackTrace(java.io.PrintStream outStream)PUBLIC:
Print both the normal and internal stack traces.
printStackTrace(new PrintWriter(outStream));
|
public void | printStackTrace(java.io.PrintWriter writer)PUBLIC:
Print both the normal and internal stack traces.
writer.write(ExceptionMessageGenerator.getHeader("LocalExceptionStackHeader"));
writer.write(cr());
super.printStackTrace(writer);
if ((getInternalException() != null) && shouldPrintInternalException()) {
writer.write(ExceptionMessageGenerator.getHeader("InternalExceptionStackHeader"));
writer.write(cr());
getInternalException().printStackTrace(writer);
if ((getInternalException() instanceof java.lang.reflect.InvocationTargetException) && ((((java.lang.reflect.InvocationTargetException)getInternalException()).getTargetException()) != null)) {
writer.write(ExceptionMessageGenerator.getHeader("TargetInvocationExceptionStackHeader"));
writer.write(cr());
((java.lang.reflect.InvocationTargetException)getInternalException()).getTargetException().printStackTrace(writer);
}
}
writer.flush();
|
public void | setErrorCode(int errorCode)INTERNAL:
this.errorCode = errorCode;
|
public void | setHasBeenLogged(boolean logged)INTERNAL:
Set this flag to avoid logging an exception more than once.
this.hasBeenLogged = logged;
|
public void | setIndentationString(java.lang.String indentationString)INTERNAL:
Used to print things nicely in the testing tool.
this.indentationString = indentationString;
|
public void | setInternalException(java.lang.Throwable anException)INTERNAL:
Used to specify the internal exception.
internalException = anException;
JavaPlatform.setExceptionCause(this, anException);
|
public void | setSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)INTERNAL:
this.session = session;
|
public static void | setShouldPrintInternalException(boolean printException)PUBLIC:
Allows overiding of TopLink's exception chaining detection.
shouldPrintInternalException = new Boolean(printException);
|
public static boolean | shouldPrintInternalException()INTERNAL
Check to see if the TopLink-stored internal exception should be printed in this
a TopLinkException's stack trace. This method will check the static ShouldPrintInternalException
variable and if it is not set, estimate based on the JDK version used.
if (shouldPrintInternalException == null) {
shouldPrintInternalException = new Boolean(JavaPlatform.shouldPrintInternalException());
}
return shouldPrintInternalException.booleanValue();
|
public java.lang.String | toString()INTERNAL:
return getIndentationString() + ExceptionMessageGenerator.getHeader("ExceptionHeader") + getErrorCode() + "] (" + oracle.toplink.essentials.sessions.DatabaseLogin.getVersion() + "): " + getClass().getName() + getMessage();
|