public class GuardedObject extends Object implements Serializable
GuardedObject controls access to an object, by checking all requests
for the object with a Guard.| Constructor and Description |
|---|
GuardedObject(Object object,
Guard guard)
Constructs a new instance of
GuardedObject which protects access
to the specified Object using the specified Guard. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getObject()
Returns the guarded
Object if the associated Guard
permits access. |
public Object getObject() throws SecurityException
Object if the associated Guard
permits access. If access is not granted, then a SecurityException is thrown.SecurityException - if access is not granted to the guarded object.