Class ThreadPermission

  • All Implemented Interfaces:
    java.io.Serializable, java.security.Guard

    public final class ThreadPermission
    extends java.security.BasicPermission
    Permission to modify threads or thread groups normally not accessible to the current thread.

    SecureSM enforces ThreadGroup security: threads with RuntimePermission("modifyThread") or RuntimePermission("modifyThreadGroup") are only allowed to modify their current thread group or an ancestor of that group.

    In some cases (e.g. test runners), code needs to manipulate arbitrary threads, so this Permission provides for that: the targets modifyArbitraryThread and modifyArbitraryThreadGroup allow a thread blanket access to any group.

    See Also:
    ThreadGroup, SecureSM, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadPermission​(java.lang.String name)
      Creates a new ThreadPermission object.
      ThreadPermission​(java.lang.String name, java.lang.String actions)
      Creates a new ThreadPermission object.
    • Method Summary

      • Methods inherited from class java.security.BasicPermission

        equals, getActions, hashCode, implies, newPermissionCollection
      • Methods inherited from class java.security.Permission

        checkGuard, getName, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ThreadPermission

        public ThreadPermission​(java.lang.String name)
        Creates a new ThreadPermission object.
        Parameters:
        name - target name
      • ThreadPermission

        public ThreadPermission​(java.lang.String name,
                                java.lang.String actions)
        Creates a new ThreadPermission object. This constructor exists for use by the Policy object to instantiate new Permission objects.
        Parameters:
        name - target name
        actions - ignored