KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > logging > LoggingPermission


1 /*
2  * @(#)LoggingPermission.java 1.9 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
8
9 package java.util.logging;
10
11 import java.security.*;
12
13 /**
14  * The permission which the SecurityManager will check when code
15  * that is running with a SecurityManager calls one of the logging
16  * control methods (such as Logger.setLevel).
17  * <p>
18  * Currently there is only one named LoggingPermission. This is "control"
19  * and it grants the ability to control the logging configuration, for
20  * example by adding or removing Handlers, by adding or removing Filters,
21  * or by changing logging levels.
22  * <p>
23  * Programmers do not normally create LoggingPermission objects directly.
24  * Instead they are created by the security policy code based on reading
25  * the security policy file.
26  *
27  *
28  * @version 1.9, 12/19/03
29  * @since 1.4
30  * @see java.security.BasicPermission
31  * @see java.security.Permission
32  * @see java.security.Permissions
33  * @see java.security.PermissionCollection
34  * @see java.lang.SecurityManager
35  *
36  */

37
38 public final class LoggingPermission extends java.security.BasicPermission JavaDoc {
39
40     private static final long serialVersionUID = 63564341580231582L;
41
42     /**
43      * Creates a new LoggingPermission object.
44      *
45      * @param name Permission name. Must be "control".
46      * @param actions Must be either null or the empty string.
47      * @throws IllegalArgumentException if arguments are invalid
48      */

49     public LoggingPermission(String JavaDoc name, String JavaDoc actions) throws IllegalArgumentException JavaDoc {
50         super(name);
51     if (!name.equals("control")) {
52         throw new IllegalArgumentException JavaDoc("name: " + name);
53     }
54     if (actions != null && actions.length() > 0) {
55         throw new IllegalArgumentException JavaDoc("actions: " + actions);
56     }
57     }
58 }
59
Popular Tags