org.jboss.util.platform
Class PID

java.lang.Object
  extended byorg.jboss.util.platform.PID
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class PID
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Provides access to the process identifier for this virtual machine.

Currently does not support native access and generates random numbers for the process id.

See Also:
Serialized Form

Field Summary
protected  int id
          The int process identifier.
 
Constructor Summary
protected PID(int id)
          Construct a new PID.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this PID.
 boolean equals(java.lang.Object obj)
          Check if the given object is equal to this PID.
 int getID()
          Get the int process identifier.
static PID (src) getInstance()
          Get the PID for the current virtual machine.
 int hashCode()
          Return the hash code of this PID.
 java.lang.String toString()
          Return a string representation of this PID.
 java.lang.String toString(int radix)
          Return a string representation of this PID.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected final int id
The int process identifier.

Constructor Detail

PID

protected PID(int id)
Construct a new PID.

Parameters:
id - Process identifier.
Method Detail

getID

public final int getID()
Get the int process identifier.

Returns:
int process identifier.

toString

public java.lang.String toString()
Return a string representation of this PID.

Returns:
A string representation of this PID.

toString

public java.lang.String toString(int radix)
Return a string representation of this PID.

Returns:
A string representation of this PID.

hashCode

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

Returns:
The hash code of this PID.

equals

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

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

clone

public java.lang.Object clone()
Returns a copy of this PID.

Returns:
A copy of this PID.

getInstance

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

Returns:
Process identifier.