APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.management

public Class VMOption

extends Object
Class Inheritance
Imports
com.sun.management.internal.VMOptionCompositeData, javax.management.openmbean.CompositeData

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,

Author
Mandy Chung
Since
1.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
VMOption.Origin

Origin of the value of a VM option.

Field Summary

Modifier and TypeField and Description
private String
private VMOption.Origin
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
VMOption(String
Name of a VM option.
name
,
String
Value of a VM option.
value
,
boolean
true if a VM option can be set dynamically, or false otherwise.
writeable
,
VMOption.Origin
where the value of a VM option came from.
origin
)

Constructs a VMOption.

private
VMOption(CompositeData cd)

Constructs a VMOption object from a CompositeData.

Method Summary

Modifier and TypeMethod and Description
public static VMOption

Returns:

a VMOption object represented by cd if cd is not null; null otherwise.
from
(CompositeData
CompositeData representing a VMOption
cd
)

Returns a VMOption object represented by the given CompositeData.

public String

Returns:

the name of this VM option.
getName
()

Returns the name of this VM option.

public VMOption.Origin

Returns:

where the value of this VM option came from.
getOrigin
()

Returns the origin of the value of this VM option.

public String

Returns:

the value of the VM option at the time when this VMOption was created.
getValue
()

Returns the value of this VM option at the time when this VMOption was created.

public boolean

Returns:

true if this VM option is writeable; false otherwise.
isWriteable
()

Tests if this VM option is writeable.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private String name
originback to summary
private VMOption.Origin origin
valueback to summary
private String value
writeableback to summary
private boolean writeable

Constructor Detail

VMOptionback to summary
public VMOption(String name, String value, boolean writeable, VMOption.Origin origin)

Constructs a VMOption.

Parameters
name:String

Name of a VM option.

value:String

Value of a VM option.

writeable:boolean

true if a VM option can be set dynamically, or false otherwise.

origin:VMOption.Origin

where the value of a VM option came from.

Exceptions
NullPointerException:
if the name or value is null
VMOptionback to summary
private VMOption(CompositeData cd)

Constructs a VMOption object from a CompositeData.

Method Detail

fromback to summary
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

CompositeData representing a VMOption

Returns:VMOption

a VMOption object represented by cd if cd is not null; null otherwise.

Exceptions
IllegalArgumentException:
if cd does not represent a VMOption with the attributes described above.
getNameback to summary
public String getName()

Returns the name of this VM option.

Returns:String

the name of this VM option.

getOriginback to summary
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:VMOption.Origin

where the value of this VM option came from.

getValueback to summary
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:String

the value of the VM option at the time when this VMOption was created.

isWriteableback to summary
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:boolean

true if this VM option is writeable; false otherwise.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

com.sun.management back to summary

public final Enum VMOption.Origin

extends Enum<VMOption.Origin>
Class Inheritance

Origin of the value of a VM option. It tells where the value of a VM option came from.
Since
1.6

Field Summary

Modifier and TypeField and Description
public static final VMOption.Origin
ATTACH_ON_DEMAND

The VM option was set using the attach framework.

public static final VMOption.Origin
CONFIG_FILE

The VM option was set via a configuration file.

public static final VMOption.Origin
DEFAULT

The VM option has not been set and its value is the default value.

public static final VMOption.Origin
ENVIRON_VAR

The VM option was set via an environment variable.

public static final VMOption.Origin
ERGONOMIC

The VM option was set via the VM ergonomic support.

public static final VMOption.Origin
MANAGEMENT

The VM option was set via the management interface after the VM was started.

public static final VMOption.Origin
OTHER

The VM option was set via some other mechanism.

public static final VMOption.Origin
VM_CREATION

The VM option was 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.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static VMOption.Origin
public static VMOption.Origin[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ATTACH_ON_DEMANDback to summary
public static final VMOption.Origin ATTACH_ON_DEMAND

The VM option was set using the attach framework.

Since
9
CONFIG_FILEback to summary
public static final VMOption.Origin CONFIG_FILE

The VM option was set via a configuration file.

DEFAULTback to summary
public static final VMOption.Origin DEFAULT

The VM option has not been set and its value is the default value.

ENVIRON_VARback to summary
public static final VMOption.Origin ENVIRON_VAR

The VM option was set via an environment variable.

ERGONOMICback to summary
public static final VMOption.Origin ERGONOMIC

The VM option was set via the VM ergonomic support.

MANAGEMENTback to summary
public static final VMOption.Origin MANAGEMENT

The VM option was set via the management interface after the VM was started.

OTHERback to summary
public static final VMOption.Origin OTHER

The VM option was set via some other mechanism.

VM_CREATIONback to summary
public static final VMOption.Origin VM_CREATION

The VM option was 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.

Constructor Detail

Originback to summary
private Origin()

Method Detail

valueOfback to summary
public static VMOption.Origin valueOf(String name)
valuesback to summary
public static VMOption.Origin[] values()