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 HostIdentifier#resolve
.
hostname
- A hostname or IP address indicating the target
host. A VmIdentifier omitting the protocol must be resolved
against a HostIdentifier using HostIdentifier#resolve
.
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
HostIdentifier#resolve
.
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
HostIdentifier#resolve
.
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.
URI
, HostIdentifier
Access | Constructor and Description |
---|---|
public | VmIdentifier(String
a string representing a target Java Virtual Machine.
The syntax of the string must conforms to the rules
specified in the class documentation. uriString)Create a VmIdentifier instance from a string value. |
public | VmIdentifier(URI
a well formed, absolute URI indicating the
target Java Virtual Machine. uri)Create a VmIdentifier instance from a URI object. |
Modifier and Type | Method and Description |
---|---|
private URI | |
public boolean | Returns: boolean - returns true if the given object is of type VmIdentifier and its URI field is equal to this object's URI field. Otherwise, return false.the object to be test for equality. object)Overrides java. Test for quality with other objects. |
public String | Returns: String - the Authority part for this VmIdentifier.Return the Authority part of this VmIdentifier. |
public String | Returns: String - the Fragment part for this VmIdentifier.Return the Fragment part of this VmIdentifier. |
public String | Returns: String - the Host part for this VmIdentifier.Return the Host part of this VmIdentifier. |
public HostIdentifier | Returns: HostIdentifier - the host identifier for the host containing the Java Virtual Machine represented by this VmIdentifier.Return the corresponding HostIdentifier for this VmIdentifier. |
public int | Returns: int - the lvmid for this VmIdentifier.Return the Local Virtual Machine Identifier for this VmIdentifier. |
public String | Returns: String - the Path part for this VmIdentifier.Return the Path part of this VmIdentifier. |
public int | Returns: int - the Port part for this VmIdentifier.Return the Port part of this VmIdentifier. |
public String | Returns: String - the Query part for this VmIdentifier.Return the Query part of this VmIdentifier. |
public String | Returns: String - the scheme for this VmIdentifier.Return the Scheme, or protocol, portion of this VmIdentifier. |
public String | Returns: String - the Scheme Specific Part for this VmIdentifier.Return the Scheme Specific Part of this VmIdentifier. |
public URI | |
public String | Returns: String - the UserInfo part for this VmIdentifier.Return the UserInfo part of this VmIdentifier. |
public int | Returns: int - the hashcode.Overrides java. Return the hash code for this VmIdentifier. |
public String | Returns: String - a String representation of the VmIdentifier.Overrides java. Convert to a string representation. |
private void |
uri | back to summary |
---|---|
private URI uri |
VmIdentifier | back to summary |
---|---|
public VmIdentifier(String uriString) throws URISyntaxException Create a VmIdentifier instance from a string value.
|
VmIdentifier | back to summary |
---|---|
public VmIdentifier(URI uri) throws URISyntaxException Create a VmIdentifier instance from a URI object.
|
canonicalize | back to summary |
---|---|
private URI canonicalize(String uriString) throws URISyntaxException creates a canonical representation of the uriString. This method performs certain translations depending on the type of URI generated by the string. |
equals | back to summary |
---|---|
public boolean equals(Object object) Overrides java. Test for quality with other objects.
|
getAuthority | back to summary |
---|---|
public String getAuthority() Return the Authority part of this VmIdentifier.
|
getFragment | back to summary |
---|---|
public String getFragment() Return the Fragment part of this VmIdentifier.
|
getHost | back to summary |
---|---|
public String getHost() Return the Host part of this VmIdentifier.
|
getHostIdentifier | back to summary |
---|---|
public HostIdentifier getHostIdentifier() throws URISyntaxException 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
|
getLocalVmId | back to summary |
---|---|
public int getLocalVmId() Return the Local Virtual Machine Identifier for this VmIdentifier. The Local Virtual Machine Identifier is also known as the lvmid.
|
getPath | back to summary |
---|---|
public String getPath() Return the Path part of this VmIdentifier.
|
getPort | back to summary |
---|---|
public int getPort() Return the Port part of this VmIdentifier.
|
getQuery | back to summary |
---|---|
public String getQuery() Return the Query part of this VmIdentifier.
|
getScheme | back to summary |
---|---|
public String getScheme() Return the Scheme, or protocol, portion of this VmIdentifier.
|
getSchemeSpecificPart | back to summary |
---|---|
public String getSchemeSpecificPart() Return the Scheme Specific Part of this VmIdentifier.
|
getURI | back to summary |
---|---|
public URI getURI() Return the URI associated with the VmIdentifier. |
getUserInfo | back to summary |
---|---|
public String getUserInfo() Return the UserInfo part of this VmIdentifier.
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Return the hash code for this VmIdentifier. The hash code is identical to the hash code for the contained URI.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Convert to a string representation. Conversion is identical to calling getURI().toString(). This may change in a future release.
|
validate | back to summary |
---|---|
private void validate() throws URISyntaxException check that the VmIdentifier includes a unique numerical identifier for the target JVM. |