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. package java.security;
  8. /**
  9. * <p> This interface represents a guard, which is an object that is used
  10. * to protect access to another object.
  11. *
  12. * <p>This interface contains a single method, <code>checkGuard</code>,
  13. * with a single <code>object</code> argument. <code>checkGuard</code> is
  14. * invoked (by the GuardedObject <code>getObject</code> method)
  15. * to determine whether or not to allow access to the object.
  16. *
  17. * @see GuardedObject
  18. *
  19. * @version 1.12 03/12/19
  20. * @author Roland Schemers
  21. * @author Li Gong
  22. */
  23. public interface Guard {
  24. /**
  25. * Determines whether or not to allow access to the guarded object
  26. * <code>object</code>. Returns silently if access is allowed.
  27. * Otherwise, throws a SecurityException.
  28. *
  29. * @param object the object being protected by the guard.
  30. *
  31. * @exception SecurityException if access is denied.
  32. *
  33. */
  34. void checkGuard(Object object) throws SecurityException;
  35. }