securitymanager.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 1,114 行 · 第 1/5 页

HTML
1,114
字号
<B>方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkAccept(java.lang.String, int)">checkAccept</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;host,            int&nbsp;port)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程从指定的主机和端口号接受套接字连接,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkAccess(java.lang.Thread)">checkAccess</A></B>(<A HREF="Thread.html" title="java.lang 中的类">Thread</A>&nbsp;t)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程修改 thread 参数,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkAccess(java.lang.ThreadGroup)">checkAccess</A></B>(<A HREF="ThreadGroup.html" title="java.lang 中的类">ThreadGroup</A>&nbsp;g)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程修改线程组参数,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkAwtEventQueueAccess()">checkAwtEventQueueAccess</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程访问 AWT 事件队列,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkConnect(java.lang.String, int)">checkConnect</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;host,             int&nbsp;port)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程打开到指定主机和端口号的套接字连接,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkConnect(java.lang.String, int, java.lang.Object)">checkConnect</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;host,             int&nbsp;port,             <A HREF="Object.html" title="java.lang 中的类">Object</A>&nbsp;context)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许指定的安全上下文打开与指定主机和端口号的套接字连接,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkCreateClassLoader()">checkCreateClassLoader</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程创建新的类加载器,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkDelete(java.lang.String)">checkDelete</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;file)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程删除指定的文件,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkExec(java.lang.String)">checkExec</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;cmd)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程创建一个子进程,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkExit(int)">checkExit</A></B>(int&nbsp;status)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程使用特定的状态码暂停 Java 虚拟机,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkLink(java.lang.String)">checkLink</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;lib)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程动态链接由字符串参数文件指定的库代码,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkListen(int)">checkListen</A></B>(int&nbsp;port)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程等待与指定本地端口号进行连接的请求,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkMemberAccess(java.lang.Class, int)">checkMemberAccess</A></B>(<A HREF="Class.html" title="java.lang 中的类">Class</A>&lt;?&gt;&nbsp;clazz,                  int&nbsp;which)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程访问程序,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkMulticast(java.net.InetAddress)">checkMulticast</A></B>(java.net.InetAddress&nbsp;maddr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程使用(加入/离开/发送/接收)IP 多路广播,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkMulticast(java.net.InetAddress, byte)">checkMulticast</A></B>(java.net.InetAddress&nbsp;maddr,               byte&nbsp;ttl)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>已过时。</B>&nbsp;<I>由 #checkPermission(java.security.Permission) 取代</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPackageAccess(java.lang.String)">checkPackageAccess</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;pkg)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程访问由参数指定的包,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPackageDefinition(java.lang.String)">checkPackageDefinition</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;pkg)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程在参数指定的包中定义类,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPermission(java.security.Permission)">checkPermission</A></B>(java.security.Permission&nbsp;perm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果基于当前有效的安全策略,不允许执行根据给定权限所指定的请求访问,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPermission(java.security.Permission, java.lang.Object)">checkPermission</A></B>(java.security.Permission&nbsp;perm,                <A HREF="Object.html" title="java.lang 中的类">Object</A>&nbsp;context)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果拒绝指定的安全上下文访问由给定权限所指定的资源,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPrintJobAccess()">checkPrintJobAccess</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程发起一个打印作业请求,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPropertiesAccess()">checkPropertiesAccess</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程访问或修改系统属性,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkPropertyAccess(java.lang.String)">checkPropertyAccess</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程访问具有指定的 <code>key</code> 名的系统属性,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkRead(java.io.FileDescriptor)">checkRead</A></B>(java.io.FileDescriptor&nbsp;fd)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程从指定的文件描述符进行读取,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkRead(java.lang.String)">checkRead</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;file)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许调用线程读取由字符串参数指定的文件,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkRead(java.lang.String, java.lang.Object)">checkRead</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;file,          <A HREF="Object.html" title="java.lang 中的类">Object</A>&nbsp;context)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不允许指定的安全上下文读取由字符串参数所指定的文件,则抛出 <code>SecurityException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkSecurityAccess(java.lang.String)">checkSecurityAccess</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;target)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;确定是应该允许还是拒绝具有指定权限目标名的权限。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="SecurityManager.html#checkSetFactory()">checkSetFactory</A></B>()</CODE>

⌨️ 快捷键说明

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