java.lang.management
Class ManagementPermission
java.lang.Object
java.security.Permission
java.security.BasicPermission
java.lang.management.ManagementPermission
- All Implemented Interfaces:
- Serializable, Guard
public final class ManagementPermission
- extends BasicPermission
Represents the permission to view or modify the data
which forms part of the system management interfaces.
Calls to methods of the system management beans,
provided by the ManagementFactory
, may perform
checks against the current SecurityManager
(if any) before allowing the operation to proceed.
Instances of this object are supplied to the
SecurityManager
in order to perform
these checks. It is not normal for instances of this
class to be created outside the use of the
SecurityManager
.
This object can represent two types of management
permission:
- monitor — this allows access
to information such as the arguments supplied to the
virtual machine, the currently loaded classes and the
stack traces of running threads. Malicious code may
use this to obtain information about the system and
exploit any vulnerabilities found.
- control — this allows the
information stored by the management beans to be altered.
For example, additional debugging information (such
as class loading traces) may be turned on or memory
usage limits changed. Malicious code could use
this to alter the behaviour of the system.
- Since:
- 1.5
- See Also:
- Serialized Form
Constructor Summary |
ManagementPermission(String name)
Constructs a new ManagementPermission
for one of the two permission targets, "monitor"
and "control". |
ManagementPermission(String name,
String actions)
Constructs a new ManagementPermission
for one of the two permission targets, "monitor"
and "control". |
ManagementPermission
public ManagementPermission(String name)
- Constructs a new
ManagementPermission
for one of the two permission targets, "monitor"
and "control".
- Parameters:
name
- the name of the permission this instance
should represent; either "monitor" or
"control".
- Throws:
IllegalArgumentException
- if the name is not
either "monitor"
or "control".
ManagementPermission
public ManagementPermission(String name,
String actions)
- Constructs a new
ManagementPermission
for one of the two permission targets, "monitor"
and "control". Actions are not supported, so
this value should be either null
or the empty string.
- Parameters:
name
- the name of the permission this instance
should represent; either "monitor" or
"control".actions
- either null
or the
empty string.
- Throws:
IllegalArgumentException
- if the name is not
either "monitor"
or "control", or
a value for actions
is specified.