001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 // 021 // This source code implements specifications defined by the Java 022 // Community Process. In order to remain compliant with the specification 023 // DO NOT add / change / or delete method signatures! 024 // 025 026 package javax.resource; 027 028 /** 029 * @version $Rev: 484948 $ $Date: 2006-12-09 09:33:52 +0100 (Sa, 09. Dez 2006) $ 030 */ 031 public class ResourceException extends Exception { 032 private String errorCode; 033 private Exception linkedException; 034 035 public ResourceException() { 036 super(); 037 } 038 039 public ResourceException(String message) { 040 super(message); 041 } 042 043 public ResourceException(Throwable cause) { 044 super(cause); 045 } 046 047 public ResourceException(String message, Throwable cause) { 048 super(message, cause); 049 } 050 051 public ResourceException(String message, String errorCode) { 052 super(message); 053 setErrorCode(errorCode); 054 } 055 056 public String getErrorCode() { 057 return errorCode; 058 } 059 060 public void setErrorCode(String errorCode) { 061 this.errorCode = errorCode; 062 } 063 064 /** 065 * @deprecated 066 */ 067 public Exception getLinkedException() { 068 return linkedException; 069 } 070 071 /** 072 * @deprecated 073 */ 074 public void setLinkedException(Exception ex) { 075 // unit tests revealed that Throwable.initCause is not invoked 076 this.linkedException = ex; 077 } 078 }