FileDocCategorySizeDatePackage
ResourceException.javaAPI DocGlassfish v2 API6043Fri May 04 22:35:34 BST 2007javax.resource

ResourceException

public class ResourceException extends Exception
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

Fields Summary
private String
errorCode
Vendor specific error code
private Exception
linkedException
reference to another exception
Constructors Summary
public ResourceException()
Constructs a new instance with null as its detail message.

 super(); 
public ResourceException(String message)
Constructs a new instance with the specified detail message.

param
message the detail message.

	super(message);
    
public ResourceException(Throwable cause)
Constructs a new throwable with the specified cause.

param
cause a chained exception of type Throwable.

	super(cause);
    
public ResourceException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.

param
message the detail message.
param
cause a chained exception of type Throwable.

	super(message, cause);
    
public ResourceException(String message, String errorCode)
Create a new throwable with the specified message and error code.

param
message a description of the exception.
param
errorCode a string specifying the vendor specific error code.

	super(message);
	this.errorCode = errorCode;
    
Methods Summary
public java.lang.StringgetErrorCode()
Get the error code.

return
the error code.

	return this.errorCode;
    
public java.lang.ExceptiongetLinkedException()
Get the exception linked to this ResourceException

return
linked Exception, null if none
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..

	return (linkedException);
    
public java.lang.StringgetMessage()
Returns a detailed message string describing this exception.

return
a detailed message string.

	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));
    
public voidsetErrorCode(java.lang.String errorCode)
Set the error code.

param
errorCode the error code.

	this.errorCode = errorCode;
    
public voidsetLinkedException(java.lang.Exception ex)
Add a linked Exception to this ResourceException.

param
ex linked Exception
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.

	linkedException = ex;