Class InternalSecurityManager


  • public class InternalSecurityManager
    extends java.lang.SecurityManager
    This class defines a security policy based on the applet security policy, with stuff that pertains only to applets removed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAccess​(java.lang.Thread t)
      Applets are not allowed to manipulate threads outside applet thread groups.
      void checkAccess​(java.lang.ThreadGroup g)
      Applets are not allowed to manipulate thread groups outside applet thread groups.
      void checkPackageAccess​(java.lang.String pkgname)
      Throws a SecurityException if the calling thread is not allowed to access the package specified by the argument.
      protected boolean inThreadGroup​(java.lang.Thread thread)
      Returns true of the threadgroup of thread is in the applet's own threadgroup.
      protected boolean inThreadGroup​(java.lang.ThreadGroup g)
      Returns true if this threadgroup is in the applet's own thread group.
      void reset()
      Reset from Properties.
      • Methods inherited from class java.lang.SecurityManager

        checkAccept, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getClassContext, getSecurityContext, getThreadGroup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InternalSecurityManager

        public InternalSecurityManager()
        Construct and initialize.
    • Method Detail

      • reset

        public void reset()
        Reset from Properties.
      • inThreadGroup

        protected boolean inThreadGroup​(java.lang.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​(java.lang.Thread thread)
        Returns true of the threadgroup of thread is in the applet's own threadgroup.
      • checkAccess

        public void checkAccess​(java.lang.Thread t)
        Applets are not allowed to manipulate threads outside applet thread groups. However a terminated thread no longer belongs to any group.
        Overrides:
        checkAccess in class java.lang.SecurityManager
      • checkAccess

        public void checkAccess​(java.lang.ThreadGroup g)
        Applets are not allowed to manipulate thread groups outside applet thread groups.
        Overrides:
        checkAccess in class java.lang.SecurityManager
      • checkPackageAccess

        public void checkPackageAccess​(java.lang.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 SecurityManager calls checkPermission with the RuntimePermission("accessClassInPackage."+ pkgname) permission.

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