Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
Training Index

Writing Advanced Applications
Appendix C: Security Manager Methods

[<<BACK] [CONTENTS] [NEXT>>]

This table shows which permissions are checked for by the default implementations of the java.lang.SecurityManager methods. Each of the check methods calls the SecurityManager.checkPermission method with the indicated permission, except for the checkConnect and checkRead methods that take a context argument. The checkConnect and checkRead methods expect the context to be an AccessControlContext and they call the context's checkPermission method with the specified permission.


public void checkAccept(String host, int port);
java.net.SocketPermission "{host}:{port}", "accept";

public void checkAccess(Thread g);
java.lang.RuntimePermission "modifyThread");

public void checkAccess(ThreadGroup g);
java.lang.RuntimePermission "modifyThreadGroup");

public void checkAwtEventQueueAccess();
java.awt.AWTPermission "accessEventQueue";

public void checkConnect(String host, int port);
if (port == -1) 
  java.net.SocketPermission "{host}","resolve"; 
else 
  java.net.SocketPermission "{host}:{port}","connect";

public void checkConnect(String host, int port, 
                         Object context);
if (port == -1) 
  java.net.SocketPermission "{host}","resolve"; 
else  
  java.net.SocketPermission "{host}:{port}","connect";

public void checkCreateClassLoader();
java.lang.RuntimePermission "createClassLoader";

public void checkDelete(String file);
java.io.FilePermission "{file}", "delete";

public void checkExec(String cmd);
if (cmd is an absolute path) 
  java.io.FilePermission "{cmd}", "execute";
else 
  java.io.FilePermission "-", "execute";

public void checkExit(int status);
java.lang.RuntimePermission "exitVM");

public void checkLink(String lib);
java.lang.RuntimePermission "loadLibrary.{lib}";

public void checkListen(int port);
if (port == 0)
  java.net.SocketPermission "localhost:1024-","listen";
else
  java.net.SocketPermission "localhost:{port}","listen";

public void checkMemberAccess(Class clazz, int which);
if (which != Member.PUBLIC) {
 if (currentClassLoader() != clazz.getClassLoader()) {
  checkPermission(
   new java.lang.RuntimePermission(
                    "accessDeclaredMembers"));
 }
}

public void checkMulticast(InetAddress maddr);
java.net.SocketPermission(
              maddr.getHostAddress(),"accept,connect");

public void checkMulticast(InetAddress maddr, byte ttl);
java.net.SocketPermission(
              maddr.getHostAddress(),"accept,connect");

public void checkPackageAccess(String pkg);
java.lang.RuntimePermission 
                  "accessClassInPackage.{pkg}";

public void checkPackageDefinition(String pkg);
java.lang.RuntimePermission 
                  "defineClassInPackage.{pkg}";

public void checkPrintJobAccess();
java.lang.RuntimePermission "queuePrintJob";

public void checkPropertiesAccess();
java.util.PropertyPermission "*", "read,write";

public void checkPropertyAccess(String key);
java.util.PropertyPermission "{key}", "read,write";

public void checkRead(FileDescriptor fd);
java.lang.RuntimePermission "readFileDescriptor";

public void checkRead(String file);
java.io.FilePermission "{file}", "read";

public void checkRead(String file, Object context);
java.io.FilePermission "{file}", "read";

public void checkSecurityAccess(String action);
java.security.SecurityPermission "{action}";

public void checkSetFactory();
java.lang.RuntimePermission "setFactory";

public void checkSystemClipboardAccess();
java.awt.AWTPermission "accessClipboard";

public boolean checkTopLevelWindow(Object window);
java.awt.AWTPermission "showWindowWithoutWarningBanner";

public void checkWrite(FileDescriptor fd);
java.lang.RuntimePermission "writeFileDescriptor";

public void checkWrite(String file);
java.io.FilePermission "{file}", "write";

public SecurityManager();
java.lang.RuntimePermission "createSecurityManager";

[TOP]


[ This page was updated: 13-Oct-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.