Microsoft SDK for Java

ThreadPermission Class

The ThreadPermission Class of the com.ms.security.permissions package represents a permission that controls the ability to create and manipulate threads and thread groups. The StandardSecurityManager class checks for this permission type when performing its checkAccess methods.

public class ThreadPermission implements IPermission,
            IEncodablePermission, IAdjustablePermission
{
  // Constructors
  public ThreadPermission();

  // Methods
  public void adjustPermission(String tag, Object adjustment);
  public void check(Object param) throws SecurityException;
  public IPermission combine(IPermission source2);
  public int compareSet(Object target);
  public IPermission copy();
  public boolean decode(String tag, InputStream data);
  public boolean encode(String tag, OutputStream out);
  public ThreadGroup getAllowedThreadGroup();
  public boolean isThreadAccessUnrestricted();
  public boolean isThreadGroupAccessUnrestricted();
  public String mapFormat(String format);
  public void reset();
  public void setAllowedThreadGroup(ThreadGroup tg);
  public void setUnrestrictedThreadAccess(boolean f);
  public void setUnrestrictedThreadGroupAccess(boolean flag);
  public String[] supportedFormats();
  public String toString();
}

You can use a ThreadPermission object to allow unrestricted thread or thread group access. Or, you can specify a ThreadGroup instance that defines a subset of the thread group space, within which the ThreadPermission object allows threading operations to take place.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.