|
JavaTM 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 Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。