ResourceException (Java EE 5)

Java EE API


javax.resource Class ResourceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.resource.ResourceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApplicationServerInternalException, CommException, EISSystemException, IllegalStateException, InvalidPropertyException, LocalTransactionException, NotSupportedException, ResourceAdapterInternalException, ResourceAllocationException, ResourceWarning, SecurityException, SharingViolationException, UnavailableException, WorkException

public class ResourceException
extends Exception

Extends: Throwable > Exception

这是为 Connector 架构定义的异常分层结构的根接口。 ResourceException 提供以下信息:
  • 描述错误的特定于资源适配器供应商的字符串。此字符串是一个标准的 Java 异常消息,可以通过 getMessage() 方法获取。
  • 特定于资源适配器供应商的错误代码。
  • 对其他异常的引用。通常,资源异常是某个低级问题导致的。如果适用,可以将此低级异常链接到 ResourceException。注意,此方法已过时,推荐使用 J2SE 版本 1.4 异常链工具。
英文文档:

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, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
 
Method Summary
 String
 Exception
 String
 void
 void
 
Methods inherited from class java.lang.Throwable
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public ResourceException()
构造一个新实例,其详细消息为 null。
英文文档:

ResourceException

public ResourceException()
Constructs a new instance with null as its detail message.


public ResourceException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档:

ResourceException

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

Parameters:
message - the detail message.


public ResourceException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档:

ResourceException

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

Parameters:
cause - a chained exception of type Throwable.


public ResourceException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message 详细消息。
cause Throwable 类型的异常链。
英文文档:

ResourceException

public ResourceException(String message,
                         Throwable 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)
创建带指定消息和错误代码的新 throwable。
message 对异常的描述。
errorCode 指定特定于供应商的错误代码的字符串。
英文文档:

ResourceException

public ResourceException(String message,
                         String 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.

Method Detail

public void setErrorCode(String errorCode)
设置错误代码。
errorCode 错误代码。
英文文档:

setErrorCode

public void setErrorCode(String errorCode)
Set the error code.

Parameters:
errorCode - the error code.

public String getErrorCode()
获取错误代码。
return 错误代码。
英文文档:

getErrorCode

public String getErrorCode()
Get the error code.

Returns:
the error code.

public Exception getLinkedException()
获取与此 ResourceException 链接的异常。
return 链接的 Exception;如果不存在,则返回 null
deprecated J2SE 1.4 版支持链接异常工具,它允许 throwable 了解导致它抛出的另一个 throwable(如果有)。请参考 java.lang.Throwable 类的 getCauseinitCause 方法。
英文文档:

getLinkedException

public Exception getLinkedException()
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

Returns:
linked Exception, null if none

public void setLinkedException(Exception ex)
将一个链接的 Exception 添加到此 ResourceException。
ex 链接的 Exception
deprecated J2SE 1.4 版支持链接异常工具,它允许 throwable 了解导致它抛出的另一个 throwable(如果有)。请参考 java.lang.Throwable 类的 getCauseinitCause 方法。
英文文档:

setLinkedException

public void setLinkedException(Exception 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.

Parameters:
ex - linked Exception

public String getMessage()
返回描述此异常的详细消息字符串。
return 详细消息字符串。
英文文档:

getMessage

public String getMessage()
Returns a detailed message string describing this exception.

Overrides:
getMessage in class Throwable
Returns:
a detailed message string.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!