| 1 | /* RuntimePermission.java
|
|---|
| 2 | Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
|---|
| 3 |
|
|---|
| 4 | This file is part of GNU Classpath.
|
|---|
| 5 |
|
|---|
| 6 | GNU Classpath is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | GNU Classpath is distributed in the hope that it will be useful, but
|
|---|
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 14 | General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
|---|
| 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|---|
| 19 | 02111-1307 USA.
|
|---|
| 20 |
|
|---|
| 21 | Linking this library statically or dynamically with other modules is
|
|---|
| 22 | making a combined work based on this library. Thus, the terms and
|
|---|
| 23 | conditions of the GNU General Public License cover the whole
|
|---|
| 24 | combination.
|
|---|
| 25 |
|
|---|
| 26 | As a special exception, the copyright holders of this library give you
|
|---|
| 27 | permission to link this library with independent modules to produce an
|
|---|
| 28 | executable, regardless of the license terms of these independent
|
|---|
| 29 | modules, and to copy and distribute the resulting executable under
|
|---|
| 30 | terms of your choice, provided that you also meet, for each linked
|
|---|
| 31 | independent module, the terms and conditions of the license of that
|
|---|
| 32 | module. An independent module is a module which is not derived from
|
|---|
| 33 | or based on this library. If you modify this library, you may extend
|
|---|
| 34 | this exception to your version of the library, but you are not
|
|---|
| 35 | obligated to do so. If you do not wish to do so, delete this
|
|---|
| 36 | exception statement from your version. */
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | package java.lang;
|
|---|
| 40 |
|
|---|
| 41 | import java.security.*;
|
|---|
| 42 |
|
|---|
| 43 | /**
|
|---|
| 44 | * A <code>RuntimePermission</code> contains a permission name, but no
|
|---|
| 45 | * actions list. This means you either have the permission or you don't.
|
|---|
| 46 | *
|
|---|
| 47 | * Permission names have the follow the hierarchial property naming
|
|---|
| 48 | * convention. In addition, an asterisk may appear at the end of a
|
|---|
| 49 | * name if following a period or by itself.
|
|---|
| 50 | *
|
|---|
| 51 | * <table border=1>
|
|---|
| 52 | * <tr><th>Valid names</th><th>Invalid names</th></tr>
|
|---|
| 53 | * <tr><td>"accessClassInPackage.*","*"</td>
|
|---|
| 54 | * <td>"**", "*x", "*.a"</td></tr>
|
|---|
| 55 | * </table>
|
|---|
| 56 | * <br>
|
|---|
| 57 | *
|
|---|
| 58 | * The following table provides a list of all the possible RuntimePermission
|
|---|
| 59 | * permission names with a description of what that permission allows.
|
|---|
| 60 | * <br>
|
|---|
| 61 | * <table border=1>
|
|---|
| 62 | * <tr><th>Permission Name</th><th>Permission Allows</th></tr>
|
|---|
| 63 | * <tr>
|
|---|
| 64 | * <td><code>createClassLoader</code></td>
|
|---|
| 65 | * <td>creation of a class loader</td></tr>
|
|---|
| 66 | * <tr>
|
|---|
| 67 | * <td><code>getClassLoader</code></td>
|
|---|
| 68 | * <td>retrieval of the class loader for the calling class</td></tr>
|
|---|
| 69 | * <tr>
|
|---|
| 70 | * <td><code>setContextClassLoader</code></td>
|
|---|
| 71 | * <td>allows the setting of the context class loader used by a
|
|---|
| 72 | * thread including system threads</td></tr>
|
|---|
| 73 | * <tr>
|
|---|
| 74 | * <td><code>setSecurityManager</code></td>
|
|---|
| 75 | * <td>allows the application to replace the security manager with
|
|---|
| 76 | * another, possibly less restrictive one.</td></tr>
|
|---|
| 77 | * <tr>
|
|---|
| 78 | * <td><code>createSecurityManager</code></td>
|
|---|
| 79 | * <td>allows the application to create a new security manager</td></tr>
|
|---|
| 80 | * <tr>
|
|---|
| 81 | * <td><code>exitVM</code></td>
|
|---|
| 82 | * <td>allows the application to halt the virtual machine</td></tr>
|
|---|
| 83 | * <tr>
|
|---|
| 84 | * <td><code>setFactory</code></td>
|
|---|
| 85 | * <td>allows the application to set the socket factory for socket,
|
|---|
| 86 | * server socket, stream handler, or RMI socket factory.</td></tr>
|
|---|
| 87 | * <tr>
|
|---|
| 88 | * <td><code>setIO</code></td>
|
|---|
| 89 | * <td>allows the application to set System.out, System.in, and
|
|---|
| 90 | * System.err</td></tr>
|
|---|
| 91 | * <tr>
|
|---|
| 92 | * <td><code>modifyThread</code></td>
|
|---|
| 93 | * <td>allows the application to modify any thread in the virtual machine
|
|---|
| 94 | * using any of the methods <code>stop</code>, <code>resume</code>,
|
|---|
| 95 | * <code>suspend</code>, <code>setPriority</code>, and
|
|---|
| 96 | * <code>setName</code> of classs <code>Thread</code></td></tr>
|
|---|
| 97 | * <tr>
|
|---|
| 98 | * <td><code>stopThread</code></td>
|
|---|
| 99 | * <td>allows the application to <code>stop</code> any thread it has
|
|---|
| 100 | * access to in the system</td></tr>
|
|---|
| 101 | * <tr>
|
|---|
| 102 | * <td><code>modifyThreadGroup</td>
|
|---|
| 103 | * <td>allows the application to modify thread groups using any of the
|
|---|
| 104 | * methods <code>destroy</code>, <code>resume</code>,
|
|---|
| 105 | * <code>setDaemon</code>, <code>setMaxPriority</code>,
|
|---|
| 106 | * <code>stop</code>, and <code>suspend</code> of the class
|
|---|
| 107 | * <code>ThreadGroup</code></td></tr>
|
|---|
| 108 | * <tr>
|
|---|
| 109 | * <td><code>getProtectionDomain</code></td>
|
|---|
| 110 | * <td></td></tr>
|
|---|
| 111 | * <tr>
|
|---|
| 112 | * <td><code>readFileDescriptor</code></td>
|
|---|
| 113 | * <td></td></tr>
|
|---|
| 114 | * <tr>
|
|---|
| 115 | * <td><code>writeFileDescriptor</code</td>
|
|---|
| 116 | * <td></td></tr>
|
|---|
| 117 | * <tr>
|
|---|
| 118 | * <td><code>loadLibrary.{library name}</code></td>
|
|---|
| 119 | * <td></td></tr>
|
|---|
| 120 | * <tr>
|
|---|
| 121 | * <td><code>accessClassInPackage.{package name}</code></td>
|
|---|
| 122 | * <td></td></tr>
|
|---|
| 123 | * <tr>
|
|---|
| 124 | * <td><code>defineClassInPackage.{package name}</code></td>
|
|---|
| 125 | * <td></td></tr>
|
|---|
| 126 | * <tr>
|
|---|
| 127 | * <td><code>accessDeclaredMembers</code></td>
|
|---|
| 128 | * <td></td></tr>
|
|---|
| 129 | * <tr>
|
|---|
| 130 | * <td><code>queuePrintJob</code></td>
|
|---|
| 131 | * <td></td></tr>
|
|---|
| 132 | * </table>
|
|---|
| 133 | *
|
|---|
| 134 | * @since JDK 1.2
|
|---|
| 135 | *
|
|---|
| 136 | * @author Brian Jones
|
|---|
| 137 | */
|
|---|
| 138 | public final class RuntimePermission extends java.security.BasicPermission
|
|---|
| 139 | {
|
|---|
| 140 | /**
|
|---|
| 141 | *
|
|---|
| 142 | * @param permissionName the name of the granted permission
|
|---|
| 143 | *
|
|---|
| 144 | * @throws IllegalArgumentException thrown if the name contains an invalid
|
|---|
| 145 | * wildcard character
|
|---|
| 146 | */
|
|---|
| 147 | public RuntimePermission(String permissionName)
|
|---|
| 148 | {
|
|---|
| 149 | this(permissionName, null);
|
|---|
| 150 | }
|
|---|
| 151 |
|
|---|
| 152 | /**
|
|---|
| 153 | *
|
|---|
| 154 | * @param permissionName the name of the granted permission
|
|---|
| 155 | * @param actions this should always be null
|
|---|
| 156 | *
|
|---|
| 157 | * @throws IllegalArgumentException throw if the name contains an invalid
|
|---|
| 158 | * wildcard character
|
|---|
| 159 | */
|
|---|
| 160 | public RuntimePermission(String permissionName, String actions)
|
|---|
| 161 | {
|
|---|
| 162 | super(permissionName, actions);
|
|---|
| 163 | }
|
|---|
| 164 | }
|
|---|