public class VMID extends java.lang.Object implements ID
The identifier is composed of:
[ address ] - [ process id ] - [ time ] - [ counter ]
|------- UID --------|
Numbers are converted to radix(Character.MAX_RADIX) when converting to strings.
UID,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
address
The address of the current virtual machine
|
protected int |
hashCode
The hash code of this VMID
|
private static VMID |
instance
The single instance of VMID for the running Virtual Machine
|
protected PID |
pid
The process identifier of the current virtual machine
|
private static long |
serialVersionUID
The serialVersionUID
|
protected UID |
uid
A unique identifier to ensure uniqueness across the host machine
|
static byte[] |
UNKNOWN_HOST
The address used when conventional methods fail to return the address
of the current machine.
|
| Modifier | Constructor and Description |
|---|---|
protected |
VMID(byte[] address,
PID pid,
UID uid)
Construct a new VMID.
|
protected |
VMID(VMID vmid)
Copy a VMID.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asString()
Returns a VMID as a string.
|
java.lang.Object |
clone()
Returns a copy of this VMID.
|
private static VMID |
create()
Create the VMID for the current virtual mahcine.
|
boolean |
equals(java.lang.Object obj)
Check if the given object is equal to this VMID.
|
byte[] |
getAddress()
Get the address portion of this VMID.
|
private static byte[] |
getHostAddress()
Return the current host internet address.
|
static VMID |
getInstance()
Get the VMID for the current virtual machine.
|
PID |
getProcessID()
Get the process identifier portion of this VMID.
|
UID |
getUID()
Get the UID portion of this VMID.
|
int |
hashCode()
Return the hash code of this VMID.
|
java.lang.String |
toString()
Return a string representation of this VMID.
|
private static final long serialVersionUID
protected final byte[] address
protected final PID pid
protected final UID uid
protected final int hashCode
private static VMID instance
public static final byte[] UNKNOWN_HOST
protected VMID(byte[] address,
PID pid,
UID uid)
address - The address of the current virtual machine.pid - Process identifier.uid - Unique identifier.For getting a VMID instance reference.protected VMID(VMID vmid)
vmid - VMID to copy.public final byte[] getAddress()
public final PID getProcessID()
public final UID getUID()
public java.lang.String toString()
toString in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
A VMID is equals to another VMID if the address, process identifer and UID portions are equal.
equals in class java.lang.Objectobj - Object to test equality with.public java.lang.Object clone()
clone in class java.lang.Objectpublic static java.lang.String asString()
public static VMID getInstance()
private static byte[] getHostAddress()
private static VMID create()