1 /* 2 * @(#)Guard.java 1.12 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.security; 9 10 /** 11 * <p> This interface represents a guard, which is an object that is used 12 * to protect access to another object. 13 * 14 * <p>This interface contains a single method, <code>checkGuard</code>, 15 * with a single <code>object</code> argument. <code>checkGuard</code> is 16 * invoked (by the GuardedObject <code>getObject</code> method) 17 * to determine whether or not to allow access to the object. 18 * 19 * @see GuardedObject 20 * 21 * @version 1.12 03/12/19 22 * @author Roland Schemers 23 * @author Li Gong 24 */ 25 26 public interface Guard { 27 28 /** 29 * Determines whether or not to allow access to the guarded object 30 * <code>object</code>. Returns silently if access is allowed. 31 * Otherwise, throws a SecurityException. 32 * 33 * @param object the object being protected by the guard. 34 * 35 * @exception SecurityException if access is denied. 36 * 37 */ 38 void checkGuard(Object object) throws SecurityException; 39 } 40