< prev index next >

jdk/src/java.logging/share/classes/java/util/logging/LoggingPermission.java

Print this page




  42  * Instead they are created by the security policy code based on reading
  43  * the security policy file.
  44  *
  45  *
  46  * @since 1.4
  47  * @see java.security.BasicPermission
  48  * @see java.security.Permission
  49  * @see java.security.Permissions
  50  * @see java.security.PermissionCollection
  51  * @see java.lang.SecurityManager
  52  *
  53  */
  54 
  55 public final class LoggingPermission extends java.security.BasicPermission {
  56 
  57     private static final long serialVersionUID = 63564341580231582L;
  58 
  59     /**
  60      * Creates a new LoggingPermission object.
  61      *
  62      * @param name Permission name.  Must be "control".
  63      * @param actions Must be either null or the empty string.
  64      *
  65      * @throws NullPointerException if <code>name</code> is <code>null</code>.
  66      * @throws IllegalArgumentException if <code>name</code> is empty or if
  67      * arguments are invalid.
  68      */
  69     public LoggingPermission(String name, String actions) throws IllegalArgumentException {
  70         super(name);
  71         if (!name.equals("control")) {
  72             throw new IllegalArgumentException("name: " + name);
  73         }
  74         if (actions != null && actions.length() > 0) {
  75             throw new IllegalArgumentException("actions: " + actions);
  76         }
  77     }
  78 }


  42  * Instead they are created by the security policy code based on reading
  43  * the security policy file.
  44  *
  45  *
  46  * @since 1.4
  47  * @see java.security.BasicPermission
  48  * @see java.security.Permission
  49  * @see java.security.Permissions
  50  * @see java.security.PermissionCollection
  51  * @see java.lang.SecurityManager
  52  *
  53  */
  54 
  55 public final class LoggingPermission extends java.security.BasicPermission {
  56 
  57     private static final long serialVersionUID = 63564341580231582L;
  58 
  59     /**
  60      * Creates a new LoggingPermission object.
  61      *
  62      * @param name Permission name.  Must be "control" or "demandLogger".
  63      * @param actions Must be either null or the empty string.
  64      *
  65      * @throws NullPointerException if <code>name</code> is <code>null</code>.
  66      * @throws IllegalArgumentException if <code>name</code> is empty or if
  67      * arguments are invalid.
  68      */
  69     public LoggingPermission(String name, String actions) throws IllegalArgumentException {
  70         super(name);
  71         if (!name.equals("control") && !name.equals("demandLogger")) {
  72             throw new IllegalArgumentException("name: " + name);
  73         }
  74         if (actions != null && actions.length() > 0) {
  75             throw new IllegalArgumentException("actions: " + actions);
  76         }
  77     }
  78 }
< prev index next >