- java.lang.Object
- 
- com.sun.tools.attach.VirtualMachineDescriptor
 
- 
 public class VirtualMachineDescriptor extends Object Describes a Java virtual machine.A VirtualMachineDescriptoris a container class used to describe a Java virtual machine. It encapsulates an identifier that identifies a target virtual machine, and a reference to theAttachProviderthat should be used when attempting to attach to the virtual machine. The identifier is implementation-dependent but is typically the process identifier (or pid) environments where each Java virtual machine runs in its own operating system process.A VirtualMachineDescriptoralso has adisplayName. The display name is typically a human readable string that a tool might display to a user. For example, a tool that shows a list of Java virtual machines running on a system might use the display name rather than the identifier. AVirtualMachineDescriptormay be created without a display name. In that case the identifier is used as the display name.VirtualMachineDescriptorinstances are typically created by invoking theVirtualMachine.list()method. This returns the complete list of descriptors to describe the Java virtual machines known to all installedattach providers.- Since:
- 1.6
 
- 
- 
Constructor SummaryConstructors Constructor Description VirtualMachineDescriptor(AttachProvider provider, String id)Creates a virtual machine descriptor from the given components.VirtualMachineDescriptor(AttachProvider provider, String id, String displayName)Creates a virtual machine descriptor from the given components.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdisplayName()Return the display name component of this descriptor.booleanequals(Object ob)Tests this VirtualMachineDescriptor for equality with another object.inthashCode()Returns a hash-code value for this VirtualMachineDescriptor.Stringid()Return the identifier component of this descriptor.AttachProviderprovider()Return theAttachProviderthat this descriptor references.StringtoString()Returns the string representation of theVirtualMachineDescriptor.
 
- 
- 
- 
Constructor Detail- 
VirtualMachineDescriptorpublic VirtualMachineDescriptor(AttachProvider provider, String id, String displayName) Creates a virtual machine descriptor from the given components.- Parameters:
- provider- The AttachProvider to attach to the Java virtual machine.
- id- The virtual machine identifier.
- displayName- The display name.
- Throws:
- NullPointerException- If any of the arguments are- null
 
 - 
VirtualMachineDescriptorpublic VirtualMachineDescriptor(AttachProvider provider, String id) Creates a virtual machine descriptor from the given components.This convenience constructor works as if by invoking the three-argument constructor as follows: newVirtualMachineDescriptor(provider, id, id);That is, it creates a virtual machine descriptor such that the display name is the same as the virtual machine identifier. - Parameters:
- provider- The AttachProvider to attach to the Java virtual machine.
- id- The virtual machine identifier.
- Throws:
- NullPointerException- If- provideror- idis- null.
 
 
- 
 - 
Method Detail- 
providerpublic AttachProvider provider() Return theAttachProviderthat this descriptor references.- Returns:
- The AttachProviderthat this descriptor references.
 
 - 
idpublic String id() Return the identifier component of this descriptor.- Returns:
- The identifier component of this descriptor.
 
 - 
displayNamepublic String displayName() Return the display name component of this descriptor.- Returns:
- The display name component of this descriptor.
 
 - 
hashCodepublic int hashCode() Returns a hash-code value for this VirtualMachineDescriptor. The hash code is based upon the descriptor's components, and satifies the general contract of theObject.hashCodemethod.- Overrides:
- hashCodein class- Object
- Returns:
- A hash-code value for this descriptor.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
equalspublic boolean equals(Object ob) Tests this VirtualMachineDescriptor for equality with another object.If the given object is not a VirtualMachineDescriptor then this method returns false. For two VirtualMachineDescriptors to be considered equal requires that they both reference the same provider, and theiridentifiersare equal.This method satisfies the general contract of the Object.equalsmethod.- Overrides:
- equalsin class- Object
- Parameters:
- ob- The object to which this object is to be compared
- Returns:
- trueif, and only if, the given object is a VirtualMachineDescriptor that is equal to this VirtualMachineDescriptor.
- See Also:
- Object.hashCode(),- HashMap
 
 
- 
 
-