Class VirtualMachineDescriptor
A VirtualMachineDescriptor is a container class used to
describe a Java virtual machine. It encapsulates an identifier that identifies
a target virtual machine, and a reference to the AttachProvider that 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 VirtualMachineDescriptor also has a displayName.
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. A VirtualMachineDescriptor may be
created without a display name. In that case the identifier is
used as the display name.
VirtualMachineDescriptor instances are typically created by
invoking the VirtualMachine.list()
method. This returns the complete list of descriptors to describe the
Java virtual machines known to all installed attach providers.
- Since:
- 1.6
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualMachineDescriptor(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 Summary
Modifier and TypeMethodDescriptionReturn the display name component of this descriptor.booleanTests this VirtualMachineDescriptor for equality with another object.inthashCode()Returns a hash-code value for this VirtualMachineDescriptor.id()Return the identifier component of this descriptor.provider()Return theAttachProviderthat this descriptor references.toString()Returns the string representation of theVirtualMachineDescriptor.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
VirtualMachineDescriptor
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 arenull
-
VirtualMachineDescriptor
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- Ifprovideroridisnull.
-
-
Method Details
-
provider
Return theAttachProviderthat this descriptor references.- Returns:
- The
AttachProviderthat this descriptor references.
-
id
Return the identifier component of this descriptor.- Returns:
- The identifier component of this descriptor.
-
displayName
Return the display name component of this descriptor.- Returns:
- The display name component of this descriptor.
-
hashCode
public int hashCode()Returns a hash-code value for this VirtualMachineDescriptor. The hash code is based upon the descriptor's components, and satisfies the general contract of theObject.hashCodemethod. -
equals
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. -
toString
-