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:
InvalidPropertyException, WorkCompletedException, ApplicationServerInternalException, WorkException, ResourceAdapterInternalException, ResourceWarning, UnavailableException, LocalTransactionException, WorkRejectedException, NotSupportedException, CommException, ResourceAllocationException, IllegalStateException, SharingViolationException, SecurityException, EISSystemException
This is the root interface of the exception hierarchy defined
for the Connector architecture.
The ResourceException provides the following information:
- A resource adapter vendor specific string describing the error.
This string is a standard Java exception message and is available
through getMessage() method.
- resource adapter vendor specific error code.
- reference to another exception. Often a resource exception
will be result of a lower level problem. If appropriate, this
lower level exception can be linked to the ResourceException.
Note, this has been deprecated in favor of J2SE release 1.4 exception
chaining facility.
- version:
1.0 -
- author:
Rahul - Sharma
- author:
Ram - Jeyaraman
| Constructor: |
public ResourceException() {
super();
}
Constructs a new instance with null as its detail message. |
public ResourceException(String message) {
super(message);
}
Constructs a new instance with the specified detail message. Parameters:
message - the detail message.
|
public ResourceException(Throwable cause) {
super(cause);
}
Constructs a new throwable with the specified cause. Parameters:
cause - a chained exception of type Throwable.
|
public ResourceException(String message,
Throwable cause) {
super(message, cause);
}
Constructs a new throwable with the specified detail message and cause. Parameters:
message - the detail message.
cause - a chained exception of type Throwable.
|
public ResourceException(String message,
String errorCode) {
super(message);
this.errorCode = errorCode;
}
Create a new throwable with the specified message and error code. Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
|
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from javax.resource.ResourceException Detail: |
public String getErrorCode() {
return this.errorCode;
}
|
public Exception getLinkedException() {
return (linkedException);
} Deprecated! J2SE - release 1.4 supports a chained exception facility
that allows any throwable to know about another throwable, if any,
that caused it to get thrown. Refer to getCause and
initCause methods of the
java.lang.Throwable class..
Get the exception linked to this ResourceException |
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));
}
Returns a detailed message string describing this exception. |
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
|
public void setLinkedException(Exception ex) {
linkedException = ex;
} Deprecated! J2SE - release 1.4 supports a chained exception facility
that allows any throwable to know about another throwable, if any,
that caused it to get thrown. Refer to getCause and
initCause methods of the
java.lang.Throwable class.
Add a linked Exception to this ResourceException. |