javax.resource
public class: ResourceException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.resource.ResourceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ResourceAdapterInternalException, SecurityException, UnavailableException, WorkRejectedException, LocalTransactionException, WorkCompletedException, IllegalStateException, ApplicationServerInternalException, EISSystemException, SharingViolationException, CommException, ResourceAllocationException, InvalidPropertyException, WorkException, ResourceWarning, NotSupportedException
This is the root exception for the exception hierarchy defined for the
connector architecture.
A ResourceException contains three items, the first two of which are set
from the constructor. The first is a standard message string which is
accessed via the getMessage() method. The second is an errorCode which is
accessed via the getErrorCode() method. The third is a linked exception
which provides more information from a lower level in the resource manager.
Linked exceptions are accessed via get/setLinkedException.
| Field Summary |
|---|
| static final long | serialVersionUID | |
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.resource.ResourceException Detail: |
public String getErrorCode() {
return errorCode;
}
|
public Exception getLinkedException() {
return linkedException;
}
Get any linked exception. |
public String getMessage() {
String msg = super.getMessage();
String ec = getErrorCode();
if ((msg == null) && (ec == null))
{
return null;
}
if ((msg != null) && (ec != null))
{
return (msg + ", error code: " + ec);
}
return ((msg != null) ? msg : ("error code: " + ec));
}
Get the message composed of the reason and error code. |
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
|
public void setLinkedException(Exception linkedException) {
this.linkedException = linkedException;
initCause(linkedException);
} Deprecated! use - initCause
|