home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / security / Guard.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.4 KB  |  47 lines

  1. /*
  2.  * @(#)Guard.java    1.4 98/03/18
  3.  *
  4.  * Copyright 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security;
  16.  
  17. /**
  18.  * <p> This interface represents a guard. A guard is an object that is used
  19.  * to protect access to another object. 
  20.  * 
  21.  * <p>This interface contains a single method, <code>checkGuard</code>,
  22.  * with a single <code>object</code> argument. <code>checkGuard</code> is 
  23.  * invoked (by the GuardedObject <code>getObject</code> method)
  24.  * to determine whether or not to allow access to the object.
  25.  *
  26.  * @see GuardedObject
  27.  *
  28.  * @version 1.4 98/03/18
  29.  * @author Roland Schemers
  30.  * @author Li Gong
  31.  */
  32.  
  33. public interface Guard {
  34.  
  35.     /**
  36.      * Determines whether or not to allow access to the guarded object
  37.      * <code>object</code>. Returns silently if access is allowed.
  38.      * Otherwise, throws a SecurityException.
  39.      * 
  40.      * @param object the object being protected by the guard.
  41.      *
  42.      * @exception SecurityException if access is denied.
  43.      *
  44.      */
  45.     void checkGuard(Object object) throws SecurityException;
  46. }
  47.