站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

VMID (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.id
Class VMID

java.lang.Object
  extended byorg.jboss.util.id.VMID
All Implemented Interfaces:
Cloneable, ID, Serializable

public class VMID
extends Object
implements ID

An object that uniquely identifies a virtual machine.

The identifier is composed of:

  1. The Internet address of the physical machine.
  2. The process identifier of the virtual machine.
  3. A UID to guarantee uniqness across multipule virtual machines on the same physical machine.
    [ address ] - [ process id ] - [ time ] - [ counter ]
                                   |------- UID --------|
 

Numbers are converted to radix(Character.MAX_RADIX) when converting to strings.

Version:
$Revision: 1.1 $
Author:
Jason Dillon
See Also:
UID, Serialized Form

Field Summary
protected  byte[] address
          The address of the current virtual machine
protected  int hashCode
          The hash code of this VMID
protected  PID pid
          The process identifier of the current virtual machine
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.
 
Constructor Summary
protected VMID(byte[] address, PID pid, UID uid)
          Construct a new VMID.
protected VMID(VMID vmid)
          Copy a VMID.
 
Method Summary
static String asString()
          Returns a VMID as a string.
 Object clone()
          Returns a copy of this VMID.
 boolean equals(Object obj)
          Check if the given object is equal to this VMID.
 byte[] getAddress()
          Get the address portion of this VMID.
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.
 String toString()
          Return a string representation of this VMID.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

address

protected final byte[] address
The address of the current virtual machine


pid

protected final PID pid
The process identifier of the current virtual machine


uid

protected final UID uid
A unique identifier to ensure uniqueness across the host machine


hashCode

protected final int hashCode
The hash code of this VMID


UNKNOWN_HOST

public static final byte[] UNKNOWN_HOST
The address used when conventional methods fail to return the address of the current machine.

Constructor Detail

VMID

protected VMID(byte[] address,
               PID pid,
               UID uid)
Construct a new VMID.

Parameters:
address - The address of the current virtual machine.
pid - Process identifier.
uid - Unique identifier.
See Also:
For getting a VMID instance reference.

VMID

protected VMID(VMID vmid)
Copy a VMID.

Parameters:
vmid - VMID to copy.
Method Detail

getAddress

public final byte[] getAddress()
Get the address portion of this VMID.

Returns:
The address portion of this VMID.

getProcessID

public final PID getProcessID()
Get the process identifier portion of this VMID.

Returns:
The process identifier portion of this VMID.

getUID

public final UID getUID()
Get the UID portion of this VMID.

Returns:
The UID portion of this VMID.

toString

public String toString()
Return a string representation of this VMID.

Returns:
A string representation of this VMID.

hashCode

public final int hashCode()
Return the hash code of this VMID.

Returns:
The hash code of this VMID.

equals

public boolean equals(Object obj)
Check if the given object is equal to this VMID.

A VMID is equals to another VMID if the address, process identifer and UID portions are equal.

Parameters:
obj - Object to test equality with.
Returns:
True if object is equals to this VMID.

clone

public Object clone()
Returns a copy of this VMID.

Returns:
A copy of this VMID.

asString

public static String asString()
Returns a VMID as a string.

Returns:
VMID as a string.

getInstance

public static VMID getInstance()
Get the VMID for the current virtual machine.

Returns:
Virtual machine identifier.
Throws:
NestedError - Failed to create VMID instance.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.