⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 securitymanager.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 <p> If <code>context</code> is not an instance of  <code>AccessControlContext</code> then a <code>SecurityException</code> is thrown.<DD><DL><DT><B>Parameters:</B><DD><CODE>perm</CODE> - the specified permission<DD><CODE>context</CODE> - a system-dependent security context.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the specified security context             is not an instance of <code>AccessControlContext</code>             (e.g., is <code>null</code>), or is denied access to the             resource specified by the given permission.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the permission argument is             <code>null</code>.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#getSecurityContext()"><CODE>getSecurityContext()</CODE></A>, <A HREF="../../java/security/AccessControlContext.html#checkPermission(java.security.Permission)"><CODE>AccessControlContext.checkPermission(java.security.Permission)</CODE></A></DL></DD></DL><HR><A NAME="checkCreateClassLoader()"><!-- --></A><H3>checkCreateClassLoader</H3><PRE>public void <B>checkCreateClassLoader</B>()</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to create a new class loader.  <p> This method calls <code>checkPermission</code> with the <code>RuntimePermission("createClassLoader")</code> permission. <p> If you override this method, then you should make a call to  <code>super.checkCreateClassLoader</code> at the point the overridden method would normally throw an exception.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not              have permission             to create a new class loader.<DT><B>See Also: </B><DD><A HREF="../../java/lang/ClassLoader.html#ClassLoader()"><CODE>ClassLoader.ClassLoader()</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkAccess(java.lang.Thread)"><!-- --></A><H3>checkAccess</H3><PRE>public void <B>checkAccess</B>(<A HREF="../../java/lang/Thread.html">Thread</A>&nbsp;t)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to modify the thread argument.  <p> This method is invoked for the current security manager by the  <code>stop</code>, <code>suspend</code>, <code>resume</code>,  <code>setPriority</code>, <code>setName</code>, and  <code>setDaemon</code> methods of class <code>Thread</code>.  <p> If the thread argument is a system thread (belongs to the thread group with a <code>null</code> parent) then  this method calls <code>checkPermission</code> with the <code>RuntimePermission("modifyThread")</code> permission. If the thread argument is <i>not</i> a system thread, this method just returns silently. <p> Applications that want a stricter policy should override this method. If this method is overridden, the method that overrides it should additionally check to see if the calling thread has the <code>RuntimePermission("modifyThread")</code> permission, and if so, return silently. This is to ensure that code granted that permission (such as the SDK itself) is allowed to manipulate any thread. <p> If this method is overridden, then  <code>super.checkAccess</code> should be called by the first statement in the overridden method, or the  equivalent security check should be placed in the overridden method.<DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the thread to be checked.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have              permission to modify the thread.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the thread argument is             <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Thread.html#resume()"><CODE>resume</CODE></A>, <A HREF="../../java/lang/Thread.html#setDaemon(boolean)"><CODE>setDaemon</CODE></A>, <A HREF="../../java/lang/Thread.html#setName(java.lang.String)"><CODE>setName</CODE></A>, <A HREF="../../java/lang/Thread.html#setPriority(int)"><CODE>setPriority</CODE></A>, <A HREF="../../java/lang/Thread.html#stop()"><CODE>stop</CODE></A>, <A HREF="../../java/lang/Thread.html#suspend()"><CODE>suspend</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkAccess(java.lang.ThreadGroup)"><!-- --></A><H3>checkAccess</H3><PRE>public void <B>checkAccess</B>(<A HREF="../../java/lang/ThreadGroup.html">ThreadGroup</A>&nbsp;g)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to modify the thread group argument.  <p> This method is invoked for the current security manager when a  new child thread or child thread group is created, and by the  <code>setDaemon</code>, <code>setMaxPriority</code>,  <code>stop</code>, <code>suspend</code>, <code>resume</code>, and  <code>destroy</code> methods of class <code>ThreadGroup</code>.  <p> If the thread group argument is the system thread group ( has a <code>null</code> parent) then  this method calls <code>checkPermission</code> with the <code>RuntimePermission("modifyThreadGroup")</code> permission. If the thread group argument is <i>not</i> the system thread group, this method just returns silently. <p> Applications that want a stricter policy should override this method. If this method is overridden, the method that overrides it should additionally check to see if the calling thread has the <code>RuntimePermission("modifyThreadGroup")</code> permission, and if so, return silently. This is to ensure that code granted that permission (such as the SDK itself) is allowed to manipulate any thread. <p> If this method is overridden, then  <code>super.checkAccess</code> should be called by the first statement in the overridden method, or the  equivalent security check should be placed in the overridden method.<DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the thread group to be checked.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have             permission to modify the thread group.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the thread group argument is             <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/lang/ThreadGroup.html#destroy()"><CODE>destroy</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#resume()"><CODE>resume</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#setDaemon(boolean)"><CODE>setDaemon</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#setMaxPriority(int)"><CODE>setMaxPriority</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#stop()"><CODE>stop</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#suspend()"><CODE>suspend</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkExit(int)"><!-- --></A><H3>checkExit</H3><PRE>public void <B>checkExit</B>(int&nbsp;status)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to cause the Java Virtual Machine to  halt with the specified status code.  <p> This method is invoked for the current security manager by the  <code>exit</code> method of class <code>Runtime</code>. A status  of <code>0</code> indicates success; other values indicate various  errors.  <p> This method calls <code>checkPermission</code> with the <code>RuntimePermission("exitVM")</code> permission. <p> If you override this method, then you should make a call to  <code>super.checkExit</code> at the point the overridden method would normally throw an exception.<DD><DL><DT><B>Parameters:</B><DD><CODE>status</CODE> - the exit status.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have               permission to halt the Java Virtual Machine with               the specified status.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Runtime.html#exit(int)"><CODE>exit</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkExec(java.lang.String)"><!-- --></A><H3>checkExec</H3><PRE>public void <B>checkExec</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;cmd)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to create a subprocess.  <p> This method is invoked for the current security manager by the  <code>exec</code> methods of class <code>Runtime</code>. <p> This method calls <code>checkPermission</code> with the <code>FilePermission(cmd,"execute")</code> permission if cmd is an absolute path, otherwise it calls  <code>checkPermission</code> with  <code>FilePermission("&lt;&lt;ALL FILES&gt;&gt;","execute")</code>. <p> If you override this method, then you should make a call to  <code>super.checkExec</code> at the point the overridden method would normally throw an exception.<DD><DL><DT><B>Parameters:</B><DD><CODE>cmd</CODE> - the specified system command.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have              permission to create a subprocess.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the <code>cmd</code> argument is             <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Runtime.html#exec(java.lang.String)"><CODE>Runtime.exec(java.lang.String)</CODE></A>, <A HREF="../../java/lang/Runtime.html#exec(java.lang.String, java.lang.String[])"><CODE>Runtime.exec(java.lang.String, java.lang.String[])</CODE></A>, <A HREF="../../java/lang/Runtime.html#exec(java.lang.String[])"><CODE>Runtime.exec(java.lang.String[])</CODE></A>, <A HREF="../../java/lang/Runtime.html#exec(java.lang.String[], java.lang.String[])"><CODE>Runtime.exec(java.lang.String[], java.lang.String[])</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkLink(java.lang.String)"><!-- --></A><H3>checkLink</H3><PRE>public void <B>checkLink</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;lib)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to dynamic link the library code  specified by the string argument file. The argument is either a  simple library name or a complete filename.  <p> This method is invoked for the current security manager by  methods <code>load</code> and <code>loadLibrary</code> of class  <code>Runtime</code>.  <p> This method calls <code>checkPermission</code> with the <code>RuntimePermission("loadLibrary."+lib)</code> permission. <p> If you override this method, then you should make a call to  <code>super.checkLink</code> at the point the overridden method would normally throw an exception.<DD><DL><DT><B>Parameters:</B><DD><CODE>lib</CODE> - the name of the library.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have             permission to dynamically link the library.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the <code>lib</code> argument is             <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Runtime.html#load(java.lang.String)"><CODE>Runtime.load(java.lang.String)</CODE></A>, <A HREF="../../java/lang/Runtime.html#loadLibrary(java.lang.String)"><CODE>Runtime.loadLibrary(java.lang.String)</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkRead(java.io.FileDescriptor)"><!-- --></A><H3>checkRead</H3><PRE>public void <B>checkRead</B>(<A HREF="../../java/io/FileDescriptor.html">FileDescriptor</A>&nbsp;fd)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to read from the specified file  descriptor.  <p> This method calls <code>checkPermission</code> with the <code>RuntimePermission("readFileDescriptor")</code> permission. <p> If you override this method, then you should make a call to  <code>super.checkRead</code> at the point the overridden method would normally throw an exception.<DD><DL><DT><B>Parameters:</B><DD><CODE>fd</CODE> - the system-dependent file descriptor.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the calling thread does not have             permission to access the specified file descriptor.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the file descriptor argument is             <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/io/FileDescriptor.html"><CODE>FileDescriptor</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>checkPermission</CODE></A></DL></DD></DL><HR><A NAME="checkRead(java.lang.String)"><!-- --></A><H3>checkRead</H3><PRE>public void <B>checkRead</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;file)</PRE><DL><DD>Throws a <code>SecurityException</code> if the  calling thread is not allowed to read the file specified by the  string argument.  <p> This method calls <code>checkPermission</code> with the <code>FilePermission(file,"read")</code> permission. <p> If you override this method, t

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -