com.ibm.security12.sun.applet
Class AppletSecurity

java.lang.Object
  |
  +--java.lang.SecurityManager
        |
        +--com.ibm.security12.java.lang.SecurityManager12
              |
              +--com.ibm.security12.sun.applet.AppletSecurity

public class AppletSecurity
extends SecurityManager12

This class defines an applet security policy

Version:
1.100, 09/01/98

Fields inherited from class com.ibm.security12.java.lang.SecurityManager12
inCheck
 
Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
AppletSecurity()
          Construct and initialize.
 
Method Summary
 void checkAccess(Thread t)
          Applets are not allowed to manipulate threads outside applet thread groups.
 void checkAccess(ThreadGroup g)
          Applets are not allowed to manipulate thread groups outside applet thread groups.
 void checkAwtEventQueueAccess()
          Tests if a client can get access to the AWT event queue.
 void checkPackageAccess(String pkgname)
          Throws a SecurityException if the calling thread is not allowed to access the package specified by the argument.
 ThreadGroup getThreadGroup()
          Returns the thread group of the applet.
protected  boolean inThreadGroup(Thread thread)
          Returns true if the threadgroup of thread is in the applet's own threadgroup.
protected  boolean inThreadGroup(ThreadGroup g)
          Returns true if this threadgroup is in the applet's own thread group.
 void reset()
          Reset from Properties
 
Methods inherited from class com.ibm.security12.java.lang.SecurityManager12
checkAccept, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, getSecurityContext
 
Methods inherited from class java.lang.SecurityManager
checkPermission, checkPermission, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppletSecurity

public AppletSecurity()
Construct and initialize.
Method Detail

reset

public void reset()
Reset from Properties

inThreadGroup

protected boolean inThreadGroup(ThreadGroup g)
Returns true if this threadgroup is in the applet's own thread group. This will return false if there is no current class loader.

inThreadGroup

protected boolean inThreadGroup(Thread thread)
Returns true if the threadgroup of thread is in the applet's own threadgroup.

checkAccess

public void checkAccess(Thread t)
Applets are not allowed to manipulate threads outside applet thread groups.
Overrides:
checkAccess in class SecurityManager12

checkAccess

public void checkAccess(ThreadGroup g)
Applets are not allowed to manipulate thread groups outside applet thread groups.
Overrides:
checkAccess in class SecurityManager12

checkPackageAccess

public void checkPackageAccess(String pkgname)
Throws a SecurityException if the calling thread is not allowed to access the package specified by the argument.

This method is used by the loadClass method of class loaders.

The checkPackageAccess method for class SecurityManager12 calls checkPermission with the RuntimePermission("accessClassInPackage."+pkg) permission.

Parameters:
pkg - the package name.
Throws:
SecurityException - if the caller does not have permission to access the specified package.
Overrides:
checkPackageAccess in class SecurityManager12
See Also:
ClassLoader12.loadClass(java.lang.String, boolean)

checkAwtEventQueueAccess

public void checkAwtEventQueueAccess()
Tests if a client can get access to the AWT event queue.

This method calls checkPermission with the AWTPermission("accessEventQueue") permission.

Throws:
SecurityException - if the caller does not have permission to accesss the AWT event queue.
Overrides:
checkAwtEventQueueAccess in class SecurityManager12
Since:
JDK1.1

getThreadGroup

public ThreadGroup getThreadGroup()
Returns the thread group of the applet. We consult the classloader if there is one.
Throws:
SecurityException - if the caller isn't running within a recognized applet ThreadGroup.
Overrides:
getThreadGroup in class SecurityManager