|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.security.GuardedObject
public class GuardedObject
GuardedObject 是一個用來保護對另一個物件的存取的物件。
GuardedObject 封裝一個目標物件和一個 Guard 物件,僅當 Guard 物件允許時才可能對目標物件進行存取。一旦 GuardedObject 封裝了某個物件,getObject 方法就會控制對該物件的存取,這一方法將對保護存取的 Guard 物件調用 checkGuard 方法。如果不允許存取,則拋出異常。
Guard,
Permission,
序列化表格| 建構子摘要 | |
|---|---|
GuardedObject(Object object,
Guard guard)
使用指定的物件和 guard 建構 GuardedObject。 |
|
| 方法摘要 | |
|---|---|
Object |
getObject()
獲取受保護物件;如果 guard 拒絕了對受保護物件的存取,則拋出異常。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public GuardedObject(Object object,
Guard guard)
object - 要保護的物件。guard - 保護對物件的存取的 Guard 物件。| 方法詳細資訊 |
|---|
public Object getObject()
throws SecurityException
SecurityException - 如果拒絕對受保護物件的存取。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。