Package java.lang

Examples of java.lang.RuntimePermission


  synchronized(SecurityManager.class) {
       SecurityManager sm = System.getSecurityManager();
       if (sm != null) {
    // ask the currently installed security manager if we
    // can create a new one.
     sm.checkPermission(new RuntimePermission
           ("createSecurityManager"));
        }
      initialized = true;
  }
    }
View Full Code Here


     *              the specified status.
     * @see        java.lang.Runtime#exit(int) exit
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
    public void checkExit(int status) {
  checkPermission(new RuntimePermission("exitVM."+status));
    }
View Full Code Here

     */
    public void checkLink(String lib) {
  if (lib == null) {
      throw new NullPointerException("library can't be null");
  }
        checkPermission(new RuntimePermission("loadLibrary."+lib));
    }
View Full Code Here

     */
    public void checkRead(FileDescriptor fd) {
  if (fd == null) {
      throw new NullPointerException("file descriptor can't be null");
  }
        checkPermission(new RuntimePermission("readFileDescriptor"));
    }
View Full Code Here

     */
    public void checkWrite(FileDescriptor fd) {
  if (fd == null) {
      throw new NullPointerException("file descriptor can't be null");
  }
        checkPermission(new RuntimePermission("writeFileDescriptor"));

    }
View Full Code Here

     *             permission to initiate a print job request.
     * @since   JDK1.1
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
    public void checkPrintJobAccess() {
        checkPermission(new RuntimePermission("queuePrintJob"));
    }
View Full Code Here

         * Traverse the list of packages, check for any matches.
   */
  for (int i = 0; i < pkgs.length; i++) {
      if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + ".")) {
    checkPermission(
        new RuntimePermission("accessClassInPackage."+pkg));
    break;   // No need to continue; only need to check this once
      }
  }
    }
View Full Code Here

   * Traverse the list of packages, check for any matches.
   */
  for (int i = 0; i < pkgs.length; i++) {
      if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + ".")) {
    checkPermission(
        new RuntimePermission("defineClassInPackage."+pkg));
    break; // No need to continue; only need to check this once
      }
  }
    }
View Full Code Here

     * @see        java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory) setSocketImplFactory
     * @see        java.net.URL#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory) setURLStreamHandlerFactory
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
    public void checkSetFactory() {
        checkPermission(new RuntimePermission("setFactory"));
    }
View Full Code Here

        synchronized(SecurityManager.class) {
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                // ask the currently installed security manager if we
                // can create a new one.
                sm.checkPermission(new RuntimePermission
                                   ("createSecurityManager"));
            }
            initialized = true;
        }
    }
View Full Code Here

TOP

Related Classes of java.lang.RuntimePermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.