|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.io.IOException
java.rmi.RemoteException
public class RemoteException
RemoteException 是許多與通信相關的異常的通用父級類別,這些異常可能會在執行遠端方法調用期間發生。遠端介面(擴展 java.rmi.Remote 的介面)的每個方法必須在其 throws 子句中列出 RemoteException。
從版本 1.4 開始,已對此異常作出改進,以符合通用異常鏈機制。可以在建構時提供並通過公共 detail 欄位存取的“包裹的遠端異常”現在稱為 cause,並可通過 Throwable.getCause() 方法以及前述的“遺留欄位”存取。
在 RemoteException 的實例上調用方法 Throwable.initCause(Throwable) 始終拋出 IllegalStateException。
| 欄位摘要 | |
|---|---|
Throwable |
detail
遠端異常的原因。 |
| 建構子摘要 | |
|---|---|
RemoteException()
建構一個 RemoteException。 |
|
RemoteException(String s)
建構帶指定詳細訊息的 RemoteException。 |
|
RemoteException(String s,
Throwable cause)
建構帶指定詳細訊息和原因的 RemoteException。 |
|
| 方法摘要 | |
|---|---|
Throwable |
getCause()
返回此異常的原因。 |
String |
getMessage()
返回此異常的詳細訊息,包括來自原因(如果有)方面的訊息。 |
| 從類別 java.lang.Throwable 繼承的方法 |
|---|
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 欄位詳細資訊 |
|---|
public Throwable detail
此欄位早於通用異常鏈設施。Throwable.getCause() 方法現在是獲取此資訊的首選方法。
| 建構子詳細資訊 |
|---|
public RemoteException()
RemoteException。
public RemoteException(String s)
RemoteException。
s - 詳細訊息
public RemoteException(String s,
Throwable cause)
RemoteException。此建構子將 detail 欄位設置為指定的 Throwable。
s - 詳細資訊cause - 原因| 方法詳細資訊 |
|---|
public String getMessage()
Throwable 中的 getMessagepublic Throwable getCause()
detail 欄位的值。
Throwable 中的 getCause
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。