Package org.jboss.util.platform
Class PID
- java.lang.Object
-
- org.jboss.util.platform.PID
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
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.
- Version:
- $Revision$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
id
The int process identifier.private static PID
instance
The single instance of PID for the running Virtual Machineprivate static long
serialVersionUID
The serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
PID(int id)
Construct a new PID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns a copy of this PID.private static PID
create()
Create the PID for the current virtual mahcine.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
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.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialVersionUID- See Also:
- Constant Field Values
-
id
protected final int id
The int process identifier.
-
instance
private static PID instance
The single instance of PID for the running Virtual Machine
-
-
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.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this PID.
-
toString
public java.lang.String toString(int radix)
Return a string representation of this PID.- Parameters:
radix
-- Returns:
- A string representation of this PID.
-
hashCode
public int hashCode()
Return the hash code of this PID.- Overrides:
hashCode
in classjava.lang.Object
- 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.- Overrides:
equals
in classjava.lang.Object
- 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.- Overrides:
clone
in classjava.lang.Object
- Returns:
- A copy of this PID.
-
getInstance
public static PID getInstance()
Get the PID for the current virtual machine.- Returns:
- Process identifier.
-
create
private static PID create()
Create the PID for the current virtual mahcine.- Returns:
- Process identifier.
-
-