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