Package java.security
Class GuardedObject
- java.lang.Object
-
- java.security.GuardedObject
-
- All Implemented Interfaces:
Serializable
public class GuardedObject extends Object implements Serializable
GuardedObjectcontrols access to an object, by checking all requests for the object with aGuard.- 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetObject()Returns the guardedObjectif the associatedGuardpermits access.
-
-
-
Method Detail
-
getObject
public Object getObject() throws SecurityException
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.
-
-