java.lang.Object | |
↳ | sun.jvmstat.monitor.VmIdentifier |
An abstraction that identifies a target Java Virtual Machine.
The VmIdentifier, or vmid, provides a convenient string representation
of the information needed to locate and communicate with a target
Java Virtual Machine. The string, based on a URI
, may specify
the communications protocol, host name, local vm identifier, and protocol
specific information for a target Java Virtual Machine. The format for
a VmIdentifier string is:
[protocol:][//]lvmid[@hostname][:port][/servername]The only required component of this string is the Local Virtual Machine Identifier, or lvmid, which uniquely identifies the target Java Virtual Machine on a host. The optional components of the VmIdentifier include:
protocol - The communications protocol. A VmIdentifier
omitting the protocol must be resolved against a HostIdentifier
using resolve(VmIdentifier)
.
hostname - A hostname or IP address indicating the target
host. A VmIdentifier omitting the protocol must be resolved
against a HostIdentifier using resolve(VmIdentifier)
.
port - The port for the communications protocol.
Treatment of the port parameter is implementation
(protocol) specific. A VmIdentifier omitting the protocol should
be resolved against a HostIdentifier using
resolve(VmIdentifier)
.
servername - The treatment of the Path, Query, and
Fragment components of the VmIdentifier are implementation
(protocol) dependent. A VmIdentifier omitting the protocol should
be resolved against a HostIdentifier using
resolve(VmIdentifier)
.
All VmIdentifier instances are constructed as absolute, hierarchical URIs. The constructors will accept relative (and even some malformed, though convenient) URI strings. Such strings are transformed into legitimate, absolute URI strings.
With the exception of file: based VmIdentifier strings, all VmIdentifier strings must include a lvmid. Attempting to construct a non-file based VmIdentifier that doesn't include a lvmid component will result in a MonitorException.
Here are some examples of VmIdentifier strings.
Relative URIs
1234 - Specifies the Java Virtual Machine identified by lvmid 1234 on an unnamed host. This string is transformed into the absolute form //1234, which must be resolved against a HostIdentifier.
1234@hostname - Specifies the Java Virtual Machine identified by lvmid 1234 on host hostname with an unnamed protocol. This string is transformed into the absolute form //1234@hostname, which must be resolved against a HostIdentifier.
1234@hostname:2099 - Specifies the Java Virtual Machine identified by lvmid 1234 on host hostname with an unnamed protocol, but with port 2099. This string is transformed into the absolute form //1234@hostname:2099, which must be resolved against a HostIdentifier.
Absolute URIs
rmi://1234@hostname:2099/remoteobjectname - Specifies the Java Virtual Machine identified by lvmid 1234 on host hostname accessed using the rmi: protocol through the rmi remote object named remoteobjectname as registered with the rmiserver on port 2099 on host hostname.
file:/path/file - Identifies a Java Virtual Machine through accessing a special file based protocol to use as the communications mechanism.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a VmIdentifier instance from a string value.
| |||||||||||
Create a VmIdentifier instance from a URI object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Test for quality with other objects.
| |||||||||||
Return the Authority part of this VmIdentifier.
| |||||||||||
Return the Fragment part of this VmIdentifier.
| |||||||||||
Return the Host part of this VmIdentifier.
| |||||||||||
Return the corresponding HostIdentifier for this VmIdentifier.
| |||||||||||
Return the Local Virtual Machine Identifier for this VmIdentifier.
| |||||||||||
Return the mode indicated in this VmIdentifier.
| |||||||||||
Return the Path part of this VmIdentifier.
| |||||||||||
Return the Port part of this VmIdentifier.
| |||||||||||
Return the Query part of this VmIdentifier.
| |||||||||||
Return the Scheme, or protocol, portion of this VmIdentifier.
| |||||||||||
Return the Scheme Specific Part of this VmIdentifier.
| |||||||||||
Return the URI associated with the VmIdentifier.
| |||||||||||
Return the UserInfo part of this VmIdentifier.
| |||||||||||
Return the hash code for this VmIdentifier.
| |||||||||||
Convert to a string representation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Create a VmIdentifier instance from a string value.
uriString | a string representing a target Java Virtual Machine. The syntax of the string must conforms to the rules specified in the class documentation. |
---|
URISyntaxException | Thrown when the uriString or its canonical form is poorly formed. |
---|
Create a VmIdentifier instance from a URI object.
uri | a well formed, absolute URI indicating the target Java Virtual Machine. |
---|
URISyntaxException | Thrown if the URI is missing some required component. |
---|
Test for quality with other objects.
object | the object to be test for equality. |
---|
Return the Authority part of this VmIdentifier.
Return the Fragment part of this VmIdentifier.
Return the Host part of this VmIdentifier.
Return the corresponding HostIdentifier for this VmIdentifier.
This method constructs a HostIdentifier object from the VmIdentifier. If the VmIdentifier is not specific about the protocol or other components of the URI, then the resulting HostIdentifier will be constructed based on this missing information. Typically, the missing components will have result in the HostIdentifier assigning assumed defaults that allow the VmIdentifier to be resolved according to those defaults.
For example, a VmIdentifier that specifies only a lvmid will result in a HostIdentifier for localhost utilizing the default local protocol, local:. A VmIdentifier that specifies both a vmid and a hostname will result in a HostIdentifier for the specified host with the default remote protocol, rmi:, using the protocol defaults for the port and servername components.
URISyntaxException | Thrown if a bad host URI is constructed. This exception may get encapsulated into a MonitorException in a future version. |
---|
Return the Local Virtual Machine Identifier for this VmIdentifier. The Local Virtual Machine Identifier is also known as the lvmid.
Return the mode indicated in this VmIdentifier.
Return the Path part of this VmIdentifier.
Return the Port part of this VmIdentifier.
Return the Query part of this VmIdentifier.
Return the Scheme, or protocol, portion of this VmIdentifier.
Return the Scheme Specific Part of this VmIdentifier.
Return the UserInfo part of this VmIdentifier.
Return the hash code for this VmIdentifier. The hash code is identical to the hash code for the contained URI.
Convert to a string representation. Conversion is identical to calling getURI().toString(). This may change in a future release.