Class VMOption

java.lang.Object
com.sun.management.VMOption

public class VMOption extends Object
Information about a VM option including its value and where the value came from which is referred as its origin.

Each VM option has a default value. A VM option can be set at VM creation time typically as a command line argument to the launcher or an argument passed to the VM created using the JNI invocation interface. In addition, a VM option may be set via an environment variable or a configuration file. A VM option can also be set dynamically via a management interface after the VM was started. A VMOption contains the value of a VM option and the origin of that value at the time this VMOption object was constructed. The value of the VM option may be changed after the VMOption object was constructed,

Since:
1.6
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Origin of the value of a VM option.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VMOption(String name, String value, boolean writeable, VMOption.Origin origin)
    Constructs a VMOption.
  • Method Summary

    Modifier and Type
    Method
    Description
    static VMOption
    Returns a VMOption object represented by the given CompositeData.
    Returns the name of this VM option.
    Returns the origin of the value of this VM option.
    Returns the value of this VM option at the time when this VMOption was created.
    boolean
    Tests if this VM option is writeable.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    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.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(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 by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(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 by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • VMOption

      public VMOption(String name, String value, boolean writeable, VMOption.Origin origin)
      Constructs a VMOption.
      Parameters:
      name - Name of a VM option.
      value - Value of a VM option.
      writeable - true if a VM option can be set dynamically, or false otherwise.
      origin - where the value of a VM option came from.
      Throws:
      NullPointerException - if the name or value is null
  • Method Details

    • getName

      public String getName()
      Returns the name of this VM option.
      Returns:
      the name of this VM option.
    • getValue

      public String getValue()
      Returns the value of this VM option at the time when this VMOption was created. The value could have been changed.
      Returns:
      the value of the VM option at the time when this VMOption was created.
    • getOrigin

      public VMOption.Origin getOrigin()
      Returns the origin of the value of this VM option. That is, where the value of this VM option came from.
      Returns:
      where the value of this VM option came from.
    • isWriteable

      public boolean isWriteable()
      Tests if this VM option is writeable. If this VM option is writeable, it can be set by the HotSpotDiagnosticMXBean.setVMOption method.
      Returns:
      true if this VM option is writeable; false otherwise.
    • from

      public static VMOption from(CompositeData cd)
      Returns a VMOption object represented by the given CompositeData. The given CompositeData must contain the following attributes:
      description
      Attribute Name Type
      name java.lang.String
      value java.lang.String
      origin java.lang.String
      writeable java.lang.Boolean
      Parameters:
      cd - CompositeData representing a VMOption
      Returns:
      a VMOption object represented by cd if cd is not null; null otherwise.
      Throws:
      IllegalArgumentException - if cd does not represent a VMOption with the attributes described above.