- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- java.lang.management.ManagementPermission
-
- All Implemented Interfaces:
-
Serializable
,Guard
public final class ManagementPermission extends BasicPermission
当SecurityManager运行的代码调用在Java平台的管理界面中定义的方法时,SecurityManager将检查的权限。下表提供了许可允许的简要说明,并讨论了授予代码许可的风险。
Table shows permission target name, what the permission allows, and associated risks Permission Target Name What the Permission Allows Risks of Allowing this Permission control Ability to control the runtime characteristics of the Java virtual machine, for example, enabling and disabling the verbose output for the class loading or memory system, setting the threshold of a memory pool, and enabling and disabling the thread contention monitoring support. Some actions controlled by this permission can disclose information about the running application, like the -verbose:class flag. This allows an attacker to control the runtime characteristics of the Java virtual machine and cause the system to misbehave. An attacker can also access some information related to the running application. monitor Ability to retrieve runtime information about the Java virtual machine such as thread stack trace, a list of all loaded class names, and input arguments to the Java virtual machine. This allows malicious code to monitor runtime information and uncover vulnerabilities.程序员通常不会直接创建ManagementPermission对象。 相反,它们是基于阅读安全策略文件的安全策略代码创建的。
- 从以下版本开始:
- 1.5
- 另请参见:
-
BasicPermission
,Permission
,Permissions
,PermissionCollection
,SecurityManager
, Serialized Form
-
-
构造方法摘要
构造方法 Constructor 描述 ManagementPermission(String name)
构造具有指定名称的ManagementPermission。ManagementPermission(String name, String actions)
构造一个新的ManagementPermission对象。
-
方法摘要
-
Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
-
-
-
构造方法详细信息
-
ManagementPermission
public ManagementPermission(String name)
构造具有指定名称的ManagementPermission。- 参数
-
name
- 权限名称。 必须是“监视器”或“控制”。 - 异常
-
NullPointerException
- 如果name
是null
。 -
IllegalArgumentException
- 如果name
为空或无效。
-
ManagementPermission
public ManagementPermission(String name, String actions) throws IllegalArgumentException
构造一个新的ManagementPermission对象。- 参数
-
name
- 权限名称。 必须是“监视器”或“控制”。 -
actions
- 必须为null或空字符串。 - 异常
-
NullPointerException
- 如果name
是null
。 -
IllegalArgumentException
- 如果name
为空或参数无效。
-
-