Package 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
Constructors Constructor Description GuardedObject(Object object, Guard guard)Constructs a new instance ofGuardedObjectwhich protects access to the specifiedObjectusing the specifiedGuard. -
Method Summary
-
Constructor Details
-
GuardedObject
Constructs a new instance ofGuardedObjectwhich protects access to the specifiedObjectusing the specifiedGuard.- Parameters:
object- theObjectto protect.guard- theGuardwhich protects the specifiedObject, maybenull.
-
-
Method Details
-
getObject
Returns the guardedObjectif the associatedGuardpermits access. If access is not granted, then aSecurityExceptionis thrown.- Returns:
- the guarded object.
- Throws:
SecurityException- if access is not granted to the guarded object.
-