9.11. Guarding Objects

Apart from SignedObject, which provides object authenticity, J2SDK 1.2 introduced an interface, java.security.Guard, and a class, java.security.GuardedObject, that may be used for object-level access control. A GuardedObject is used to protect access to another object. A GuardedObject encapsulates a target object and a Guard object. Once a target object is encapsulated by a GuardedObject, access to that object is controlled by the getObject method. This method invokes the checkGuard method on the java.security.Guard object that is guarding access. If access is allowed, checkGuard returns silently; if access is not allowed, it throws a SecurityException. A GuardedObject and protection of access to the target object via ...

Get Inside Java™ 2 Platform Security: Architecture, API Design, and Implementation, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.