java.security
Class GuardedObject
java.lang.Object
java.security.GuardedObject
- All Implemented Interfaces:
- Serializable
public class GuardedObject
- extends Object
- implements Serializable
GuardedObject controls access to an object, by checking all requests for the
object with a Guard.
- See Also:
- Serialized Form
|
Constructor Summary |
GuardedObject(Object object,
Guard guard)
Constructs a GuardedObject to protect access to the specified Object
using the specified Guard. |
|
Method Summary |
Object |
getObject()
Checks whether access should be granted to the object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GuardedObject
public GuardedObject(Object object,
Guard guard)
- Constructs a GuardedObject to protect access to the specified Object
using the specified Guard.
- Parameters:
object - the Object to guardguard - the Guard
getObject
public Object getObject()
throws SecurityException
- Checks whether access should be granted to the object. If access is
granted, this method returns the object. If it is not granted, then a
SecurityException is thrown.
- Returns:
- the guarded object
- Throws:
SecurityException - If access is not granted to the object
Please submit a feedback, bug or feature