Class Overview
When a SecurityManager
set, this
is the permission which will be checked when code invokes VirtalMachine.attach
to attach to a target virtual
machine.
This permission is also checked when an AttachProvider
is created.
An AttachPermission
object 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 following table provides a summary description of what the
permission allows, and discusses the risks of granting code the
permission.
Permission Target Name |
What the Permission Allows |
Risks of Allowing this Permission |
attachVirtualMachine |
Ability to attach to another Java virtual machine and load agents
into that VM.
|
This allows an attacker to control the target VM which can potentially
cause it to misbehave.
|
createAttachProvider |
Ability to create an AttachProvider instance.
|
This allows an attacker to create an AttachProvider which can
potentially be used to attach to other Java virtual machines.
|
Programmers do not normally create AttachPermission objects directly.
Instead they are created by the security policy code based on reading
the security policy file.
Summary
[Expand]
Inherited Methods |
From class
java.security.BasicPermission
boolean
|
equals(Object obj)
Checks two BasicPermission objects for equality.
|
String
|
getActions()
Returns the canonical string representation of the actions,
which currently is the empty string "", since there are no actions for
a BasicPermission.
|
int
|
hashCode()
Returns the hash code value for this object.
|
boolean
|
implies(Permission p)
Checks if the specified permission is "implied" by
this object.
|
PermissionCollection
|
newPermissionCollection()
Returns a new PermissionCollection object for storing BasicPermission
objects.
|
|
From class
java.security.Permission
void
|
checkGuard(Object object)
Implements the guard interface for a permission.
|
abstract
boolean
|
equals(Object obj)
Checks two Permission objects for equality.
|
abstract
String
|
getActions()
Returns the actions as a String.
|
final
String
|
getName()
Returns the name of this Permission.
|
abstract
int
|
hashCode()
Returns the hash code value for this Permission object.
|
abstract
boolean
|
implies(Permission permission)
Checks if the specified permission's actions are "implied by"
this object's actions.
|
PermissionCollection
|
newPermissionCollection()
Returns an empty PermissionCollection for a given Permission object, or null if
one is not defined.
|
String
|
toString()
Returns a string describing this Permission.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.security.Guard
abstract
void
|
checkGuard(Object object)
Determines whether or not to allow access to the guarded object
object .
|
|
Public Constructors
public
AttachPermission
(String name)
Constructs a new AttachPermission object.
Parameters
name
| Permission name. Must be either "attachVirtualMachine",
or "createAttachProvider". |
public
AttachPermission
(String name, String actions)
Constructs a new AttachPermission object.
Parameters
name
| Permission name. Must be either "attachVirtualMachine",
or "createAttachProvider". |
actions
| Not used and should be null , or
the empty string. |