javax.management
public class MBeanServerPermission extends BasicPermission
Represents the permissions required to perform operations provided by the {@link MBeanServerFactory}. As with all {@link java.security.Permission} objects, an instance of this class either represents a permission already held or one that is required to access a particular service. In the case of {@link MBeanServerPermission}s, implication checks are made using an instance of this class when a user requests an operation from the factory, and a {@link SecurityManager} is in place.
The permission is defined by its name, which may be
either a '*'
(to allow all) or one or
more of the following, separated by a ','
:
createMBeanServer
-- allows a registered
instance of a server to be obtained from the factory.findMBeanServer
-- allows all or one
particular server instance to be retrieved from the factory.newMBeanServer
-- allows an unregistered
instance of a server to be obtained from the factory.releaseMBeanServer
-- allows a reference to
a server instance to be removed from the factory.
The names may be surrounded by arbitrary amounts of whitespace.
createMBeanServer
implies newMBeanServer
.
Since: 1.5
Constructor Summary | |
---|---|
MBeanServerPermission(String name) Constructs a new {@link MBeanServerPermission} with the given name. | |
MBeanServerPermission(String name, String actions) Constructs a new {@link MBeanServerPermission} with the given name and actions. |
Method Summary | |
---|---|
boolean | equals(Object obj)
Returns true if the given object is also an {@link MBeanServerPermission}
with the same name.
|
int | hashCode()
Returns a unique hash code for this permission.
|
boolean | implies(Permission p)
Returns true if this {@link MBeanServerPermission} implies
the given permission. |
PermissionCollection | newPermissionCollection()
Returns a {@link PermissionCollection} which stores
a series of {@link MBeanServerPermission}s as the union
of their capabilities.
|
Constructs a new {@link MBeanServerPermission} with
the given name. The name must not be null
and must be equal to either "*"
or a
comma-separated list of valid permissions. The four
valid constraints are:
createMBeanServer
findMBeanServer
newMBeanServer
releaseMBeanServer
Calling this constructor is equivalent to calling
MBeanPermission(name, null)
.
Parameters: name the name of this permission.
Throws: NullPointerException if name
is null
. IllegalArgumentException if name
is not either equal to
"*"
or forms
a comma-separated list of
valid constraints.
See Also: MBeanServerPermission
Constructs a new {@link MBeanServerPermission} with
the given name and actions. The actions are unused,
and must be either null
or the empty
string. The name must not be null
and must be equal to either "*"
or a
comma-separated list of valid permissions. The four
valid constraints are:
createMBeanServer
findMBeanServer
newMBeanServer
releaseMBeanServer
Calling this constructor is equivalent to calling
MBeanPermission(name, null)
.
Parameters: name the name of this permission.
Throws: NullPointerException if name
is null
. IllegalArgumentException if name
is not either equal to
"*"
or forms
a comma-separated list of
valid constraints, or if
actions
is not
null
or the
empty string.
See Also: MBeanServerPermission
Parameters: obj the object to compare with this one.
Returns: true if the object is an {@link MBeanPermission} with the same name.
Returns: the hashcode of this permission.
createMBeanServer
implies
newMBeanServer
.
Parameters: p the permission to check for implication.
Returns: true if this permission implies p
.
Returns: a collection for {@link MBeanServerPermission}s.