- /*
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
- package javax.resource;
-
- /**
- * This is the root interface of the exception hierarchy defined
- * for the Connector architecture.
- *
- * The ResourceException provides the following information:
- * <UL>
- * <LI> A resource adapter vendor specific string describing the error.
- * This string is a standard Java exception message and is available
- * through getMessage() method.
- * <LI> resource adapter vendor specific error code
- * <LI> 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.
- * </UL>
- * @version 0.7
- * @author Rahul Sharma
- */
-
- public class ResourceException extends java.lang.Exception {
-
- /** Vendor specific error code
- **/
- private String errorCode;
-
- /** reference to another exception
- **/
- private Exception linkedException;
-
- /**
- * Create a ResourceException.
- *
- * @param reason a description of the exception
- * @param errorCode a string specifying the vendor specific
- * error code
- **/
- public
- ResourceException(String reason, String errorCode) {
- super(reason);
- this.errorCode = errorCode;
- this.linkedException = null;
-
- }
-
- /**
- * Create a ResourceException with reason.
- *
- * @param reason a description of the exception
- **/
- public
- ResourceException(String reason) {
- super(reason);
- this.errorCode = null;
- this.linkedException = null;
- }
-
- /** Get the vendor specific error code
- * @return a string specifying the vendor specific error code
- **/
- public
- String getErrorCode() {
- return this.errorCode;
- }
-
- /**
- * Get the exception linked to this ResourceException
- *
- * @return linked Exception, null if none
- **/
- public
- Exception getLinkedException() {
- return (linkedException);
- }
-
- /**
- * Add a linked Exception to this ResourceException.
- *
- * @param ex linked Exception
- **/
- public
- void setLinkedException(Exception ex) {
- linkedException = ex;
- }
- }