CLDC 1.1.1

java.lang
Class RuntimePermission

java.lang.Object
  extended byjava.security.Permission
      extended byjava.security.BasicPermission
          extended byjava.lang.RuntimePermission

public final class RuntimePermission
extends BasicPermission

This class is for runtime permissions. A RuntimePermission contains a name (also referred to as a "target name") but no actions list; you either have the named permission or you don't.

The target name is the name of the runtime permission (see below). The naming convention follows the hierarchical property naming convention. Also, an asterisk may appear at the end of the name, following a ".", or by itself, to signify a wildcard match. For example: "target.*" or "*" is valid, "*target" or "a*b" is not valid.

The following table lists all the possible RuntimePermission target names, and for each provides a description of what the permission allows and a discussion of the risks of granting code the permission.

Permission Target Name What the Permission Allows Risks of Allowing this Permission
exitVM Halting of the Java Virtual Machine This allows an attacker to mount a denial-of-service attack by automatically forcing the virtual machine to halt.
modifyThread Modification of threads, e.g., via calls to Thread interrupt and setPriority methods This allows an attacker to modify the behavior of any thread in the system.

See Also:
BasicPermission, Permission, PermissionCollection

Constructor Summary
RuntimePermission(String name)
          Creates a new RuntimePermission with the specified name.
RuntimePermission(String name, String actions)
          Creates a new RuntimePermission object with the specified name.
 
Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection
 
Methods inherited from class java.security.Permission
getName, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuntimePermission

public RuntimePermission(String name)
Creates a new RuntimePermission with the specified name. The name is the symbolic name of the RuntimePermission, such as "exitVM", "modifyThread", etc. An asterisk may appear at the end of the name, following a ".", or by itself, to signify a wildcard match.

Parameters:
name - the name of the RuntimePermission.
Throws:
NullPointerException - if name is null.
IllegalArgumentException - if name is empty.

RuntimePermission

public RuntimePermission(String name,
                         String actions)
Creates a new RuntimePermission object with the specified name. The name is the symbolic name of the RuntimePermission, and the actions String is currently unused and should be null.

Parameters:
name - the name of the RuntimePermission.
actions - should be null.
Throws:
NullPointerException - if name is null.
IllegalArgumentException - if name is empty

CLDC 1.1.1

Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. Use of this specification is subject to license terms.