securitymanager.java

来自「《移动Agent技术》一书的所有章节源代码。」· Java 代码 · 共 839 行 · 第 1/3 页

JAVA
839
字号
     * @exception  SecurityException  if the caller does not have permission
     *               to modify the thread group.
     * @see        java.lang.System#getSecurityManager()
     * @see        java.lang.ThreadGroup#destroy()
     * @see        java.lang.ThreadGroup#resume()
     * @see        java.lang.ThreadGroup#setDaemon(boolean)
     * @see        java.lang.ThreadGroup#setMaxPriority(int)
     * @see        java.lang.ThreadGroup#stop()
     * @see        java.lang.ThreadGroup#suspend()
     * @since      JDK1.0
     */
    public void checkAccess(ThreadGroup g) {
	throw new SecurityException();
    }

    /**
     * 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>
     * The <code>checkExit</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      status   the exit status.
     * @exception  SecurityException  if the caller does not have permission
     *               to halt the Java Virtual Machine with the specified status.
     * @see        java.lang.Runtime#exit(int)
     * @see        java.lang.System#getSecurityManager()
     * @since      JDK1.0
     */
    public void checkExit(int status) {
	throw new SecurityException();
    }

    /**
     * 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>
     * The <code>checkExec</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      cmd   the specified system command.
     * @exception  SecurityException  if the caller does not have permission
     *               to create a subprocess.
     * @see        java.lang.Runtime#exec(java.lang.String)
     * @see        java.lang.Runtime#exec(java.lang.String, java.lang.String[])
     * @see        java.lang.Runtime#exec(java.lang.String[])
     * @see        java.lang.Runtime#exec(java.lang.String[], java.lang.String[])
     * @see        java.lang.System#getSecurityManager()
     * @since      JDK1.0
     */
    public void checkExec(String cmd) {
	throw new SecurityException();
    }

    /**
     * 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>
     * The <code>checkLink</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      lib   the name of the library.
     * @exception  SecurityException  if the caller does not have permission
     *               to dynamically link the library.
     * @see        java.lang.Runtime#load(java.lang.String)
     * @see        java.lang.Runtime#loadLibrary(java.lang.String)
     * @see        java.lang.System#getSecurityManager()
     * @since      JDK1.0
     */
    public void checkLink(String lib) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to read from the specified file
     * descriptor.
     * <p>
     * The <code>checkRead</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      fd   the system-dependent file descriptor.
     * @exception  SecurityException  if the caller does not have permission
     *               to access the specified file descriptor.
     * @see        java.io.FileDescriptor
     * @since      JDK1.0
     */
    public void checkRead(FileDescriptor fd) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to read the file specified by the
     * string argument.
     * <p>
     * The <code>checkRead</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      file   the system-dependent file name.
     * @exception  SecurityException  if the caller does not have permission
     *               to access the specified file.
     * @since   JDK1.0
     */
    public void checkRead(String file) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * specified security context is not allowed to read the file
     * specified by the string argument. The context must be a security
     * context returned by a previous call to
     * <code>getSecurityContext</code>.
     * <p>
     * The <code>checkRead</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      file      the system-dependent filename.
     * @param      context   a system-dependent security context.
     * @exception  SecurityException  if the specified security context does
     *               not have permission to read the specified file.
     * @see        java.lang.SecurityManager#getSecurityContext()
     * @since      JDK1.0
     */
    public void checkRead(String file, Object context) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to write to the specified file
     * descriptor.
     * <p>
     * The <code>checkWrite</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      fd   the system-dependent file descriptor.
     * @exception  SecurityException  if the caller does not have permission
     *               to access the specified file descriptor.
     * @see        java.io.FileDescriptor
     * @since      JDK1.0
     */
    public void checkWrite(FileDescriptor fd) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to write to the file specified by
     * the string argument.
     * <p>
     * The <code>checkWrite</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      file   the system-dependent filename.
     * @exception  SecurityException  if the caller does not have permission
     *               to access the specified file.
     * @since   JDK1.0
     */
    public void checkWrite(String file) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to delete the specified file.
     * <p>
     * This method is invoked for the current security manager by the
     * <code>delete</code> method of class <code>File</code>.
     * <p>
     * The <code>checkDelete</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      file   the system-dependent filename.
     * @exception  SecurityException  if the caller does not have permission
     *               to delete the file.
     * @see        java.io.File#delete()
     * @see        java.lang.System#getSecurityManager()
     * @since      JDK1.0
     */
    public void checkDelete(String file) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to open a socket connection to the
     * specified host and port number.
     * <p>
     * A port number of <code>-1</code> indicates that the calling
     * method is attempting to determine the IP address of the specified
     * host name.
     * <p>
     * The <code>checkConnect</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      host   the host name port to connect to.
     * @param      port   the protocol port to connect to.
     * @exception  SecurityException  if the caller does not have permission
     *               to open a socket connection to the specified
     *               <code>host</code> and <code>port</code>.
     * @since      JDK1.0
     */
    public void checkConnect(String host, int port) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * specified security context is not allowed to open a socket
     * connection to the specified host and port number.
     * <p>
     * A port number of <code>-1</code> indicates that the calling
     * method is attempting to determine the IP address of the specified
     * host name.
     * <p>
     * The <code>checkConnect</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      host      the host name port to connect to.
     * @param      port      the protocol port to connect to.
     * @param      context   a system-dependent security context.
     * @exception  SecurityException  if the specified security context does
     *               not have permission to open a socket connection to the
     *               specified <code>host</code> and <code>port</code>.
     * @see        java.lang.SecurityManager#getSecurityContext()
     * @since      JDK1.0
     */
    public void checkConnect(String host, int port, Object context) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to wait for a connection request on
     * the specified local port number.
     * <p>
     * The <code>checkListen</code> method for class
     * <code>SecurityManager</code> always throws a
     * <code>SecurityException</code>.
     *
     * @param      port   the local port.
     * @exception  SecurityException  if the caller does not have permission
     *               to listen on the specified port.
     * @since   JDK1.0
     */
    public void checkListen(int port) {
	throw new SecurityException();
    }

    /**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not permitted to accept a socket connection from

⌨️ 快捷键说明

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