/* * @(#)Guard.java 1.12 03/12/19 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.security; /** *
This interface represents a guard, which is an object that is used * to protect access to another object. * *
This interface contains a single method, checkGuard
,
* with a single object
argument. checkGuard
is
* invoked (by the GuardedObject getObject
method)
* to determine whether or not to allow access to the object.
*
* @see GuardedObject
*
* @version 1.12 03/12/19
* @author Roland Schemers
* @author Li Gong
*/
public interface Guard {
/**
* Determines whether or not to allow access to the guarded object
* object
. Returns silently if access is allowed.
* Otherwise, throws a SecurityException.
*
* @param object the object being protected by the guard.
*
* @exception SecurityException if access is denied.
*
*/
void checkGuard(Object object) throws SecurityException;
}