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

📄 javalang.doc16.html

📁 java语言规范
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p><font size=+1><strong>20.17.7   </strong> <code>protected int <code><b>classLoaderDepth</b></code>()</code></font>
<p>
<a name="30031"></a>
This utility method for security managers searches the execution stack for the current
thread to find the most recently invoked method whose execution has not yet 
completed and whose class was created by a class loader <a href="javalang.doc13.html#14462">(&#167;20.14)</a>. If such a 
method is found, its distance from the top of the stack is returned as a nonnegative 
integer; otherwise, <code>-1</code> is returned.
<p><a name="14107"></a>
<p><font size=+1><strong>20.17.8   </strong> <code>protected boolean <code><b>inClassLoader</b></code>()</code></font>
<p>
<a name="30043"></a>
This utility method for security managers searches the execution stack for the current
thread to find the most recently invoked method whose execution has not yet 
completed and whose class was created by a class loader <a href="javalang.doc13.html#14462">(&#167;20.14)</a>. If such a 
method is found, <code>true</code> is returned; otherwise <code>false</code> is returned.
<p><a name="29978"></a>
<p><font size=+1><strong>20.17.9   </strong> <code>public boolean <code><b>getInCheck</b></code>()</code></font>
<p>
<a name="29982"></a>
The value of the <code>inCheck</code> field <a href="javalang.doc16.html#5906">(&#167;20.17.1)</a> is returned.
<p><a name="14108"></a>
<p><font size=+1><strong>20.17.10   </strong> <code>public void <code><b>checkCreateClassLoader</b></code>()<br>throws SecurityException</code></font>
<p>
<a name="19929"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if creation of a class loader is not permitted.
<p><a name="19933"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by the constructor for class <code>ClassLoader</code> <a href="javalang.doc13.html#14060">(&#167;20.14.1)</a>.<p>
<a name="19940"></a>
The <code>checkCreateClassLoader</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a class loader creation operation is to be permitted with a security manager installed.<p>
<a name="14109"></a>
<p><font size=+1><strong>20.17.11   </strong> <code>public void <code><b>checkAccess</b></code>(Thread t)<br>throws SecurityException</code></font>
<p>
<a name="19955"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if an operation that would modify the thread <code>t</code> is not permitted.
<p><a name="19959"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by method <code>checkAccess</code> <a href="javalang.doc18.html#8265">(&#167;20.20.12)</a> of class <code>Thread</code>.<p>
<a name="19960"></a>
The <code>checkAccess</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a thread modification operation is to be permitted with a security manager installed.<p>
<a name="14110"></a>
<p><font size=+1><strong>20.17.12   </strong> <code>public void <code><b>checkAccess</b></code>(ThreadGroup g)<br>throws SecurityException</code></font>
<p>
<a name="19964"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if an operation that would modify the thread group <code>g</code> is not permitted.
<p><a name="19968"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by method <code>checkAccess</code> <a href="javalang.doc19.html#27041">(&#167;20.21.4)</a> of class <code>ThreadGroup</code>.<p>
<a name="19969"></a>
The <code>checkAccess</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a thread group modification operation is to be permitted with a security manager installed.<p>
<a name="14111"></a>
<p><font size=+1><strong>20.17.13   </strong> <code>public void <code><b>checkExit</b></code>(int status)<br>throws SecurityException</code></font>
<p>
<a name="5946"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if an exit operation that would terminate the running Java Virtual Machine is not 
permitted.
<p><a name="5949"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by method <code>exit</code> <a href="javalang.doc15.html#34351">(&#167;20.16.2)</a> of class <code>Runtime</code>.<p>
<a name="5950"></a>
The <code>checkExit</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if the exit operation is to be permitted with a security manager installed.<p>
<a name="14112"></a>
<p><font size=+1><strong>20.17.14   </strong> <code>public void <code><b>checkExec</b></code>(String cmd)<br>throws SecurityException</code></font>
<p>
<a name="19973"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if a command <code>exec</code> operation is not permitted. The argument <code>cmd</code> is the name of 
the command to be executed.
<p><a name="19977"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by method <code>exec</code> <a href="javalang.doc15.html#6806">(&#167;20.16.6)</a> of class <code>Runtime</code>.<p>
<a name="19978"></a>
The <code>checkExec</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a command <code>exec</code> operation is to be permitted with a security manager installed.<p>
<a name="29869"></a>
<p><font size=+1><strong>20.17.15   </strong> <code>public void <code><b>checkPropertiesAccess</b></code>()<br>throws SecurityException</code></font>
<p>
<a name="29870"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if getting or setting the system properties data structure is not permitted.
<p><a name="29874"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by the methods <code>getProperties</code> <a href="javalang.doc17.html#6014">(&#167;20.18.7)</a> and <code>setProperties</code> <a href="javalang.doc17.html#5986">(&#167;20.18.8)</a> of class <code>System</code>.<p>
<a name="29881"></a>
The <code>checkPropertiesAccess</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a properties access operation is to be permitted with a security manager installed.<p>
<a name="29883"></a>
<p><font size=+1><strong>20.17.16   </strong> <code>public void <code><b>checkPropertyAccess</b></code>(String key)<br>throws SecurityException</code></font>
<p>
<a name="29884"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if getting the value of the system property named by the <code>key</code> is not permitted.
<p><a name="29888"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by the methods <code>getProperty</code> of one argument (&#167;20.18.9)</a> and <code>getProperty</code> of two arguments <a href="javalang.doc17.html#5966">(&#167;20.18.10)</a> of class <code>System</code>.<p>
<a name="29895"></a>
The <code>checkPropertyAccess</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if accessing the value of a system property is to be permitted with a security manager installed.<p>
<a name="14113"></a>
<p><font size=+1><strong>20.17.17   </strong> <code>public void <code><b>checkLink</b></code>(String libname)<br>throws SecurityException</code></font>
<p>
<a name="6989"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if dynamic linking of the specified library code file is not permitted. The argument 
may be a simple library name or a complete file name.
<p><a name="6993"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by methods <code>load</code> <a href="javalang.doc15.html#30190">(&#167;20.16.13)</a> and <code>loadLibrary</code> <a href="javalang.doc15.html#52468">(&#167;20.16.14)</a> of class <code>Runtime</code>.<p>
<a name="7000"></a>
The <code>checkLink</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if a dynamic code linking operation is to be permitted with a security manager installed.<p>
<a name="14114"></a>
<p><font size=+1><strong>20.17.18   </strong> <code>public void <code><b>checkRead</b></code>(int fd)<br>throws SecurityException</code></font>
<p>
<a name="19982"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if creating an input stream using the specified file descriptor is not permitted.
<p><a name="19986"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by one constructor for <code>java.io.FileInputStream</code> <a href="javaio.doc2.html#28263">(&#167;22.4.3)</a>.<p>
<a name="19987"></a>
The <code>checkRead</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if creating an input stream from an existing file descriptor is to be permitted with a security manager installed.<p>
<a name="14115"></a>
<p><font size=+1><strong>20.17.19   </strong> <code>public void <code><b>checkRead</b></code>(String file)<br>throws SecurityException</code></font>
<p>
<a name="19991"></a>
The general contract of this method is that it should throw a <code>SecurityException</code> 
if reading the specified file or directory, or examining associated file-system information,
or testing for its existence, is not permitted.
<p><a name="19995"></a>
This method is invoked for the current security manager <a href="javalang.doc17.html#3205">(&#167;20.18.4)</a> by two constructors for <code>java.io.FileInputStream</code> (<a href="javaio.doc2.html#28248">&#167;22.4.1</a>, <a href="javaio.doc2.html#28256">&#167;22.4.2</a>); by two constructors for <code>java.io.RandomAccessFile</code> (<a href="javaio.doc21.html#27788">&#167;22.23.1</a>, <a href="javaio.doc21.html#27799">&#167;22.23.2</a>); and by methods <code>exists</code> <a href="javaio.doc22.html#29795">(&#167;22.24.16)</a>, <code>canRead</code> <a href="javaio.doc22.html#29802">(&#167;22.24.17)</a>, <code>isFile</code> <a href="javaio.doc22.html#29816">(&#167;22.24.19)</a>, <code>isDirectory</code> <a href="javaio.doc22.html#29823">(&#167;22.24.20)</a>, <code>lastModified</code> <a href="javaio.doc22.html#29830">(&#167;22.24.21)</a>, <code>length</code> <a href="javaio.doc22.html#29840">(&#167;22.24.22)</a>, <code>list</code> with no arguments <a href="javaio.doc22.html#29861">(&#167;22.24.25)</a>, and <code>list</code> with one argument <a href="javaio.doc22.html#29868">(&#167;22.24.26)</a> of the class <code>java.io.File</code>.<p>
<a name="21906"></a>
The <code>checkRead</code> method defined by class <code>SecurityManager</code> always throws a <code>SecurityException</code>. A subclass must override this method if read access to a file is to be permitted with a security manager installed.<p>
<a name="14116"></a>

⌨️ 快捷键说明

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