Name

Guard

Synopsis

This interface guards access to an object. The checkGuard( ) method is passed an object to which access has been requested. If access should be granted, checkGuard( ) should return silently. Otherwise, if access is denied, checkGuard( ) should throw a java.lang.SecurityException. The Guard object is used primarily by the GuardedObject class. Note that all Permission objects implement the Guard interface.

public interface Guard {
// Public Instance Methods
     void checkGuard(Object object) throws SecurityException;  
}

Implementations

Permission

Passed To

GuardedObject.GuardedObject( )

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.