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.CloneableProvides 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 intidThe int process identifier.private static PIDinstanceThe single instance of PID for the running Virtual Machineprivate static longserialVersionUIDThe serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedPID(int id)Construct a new PID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a copy of this PID.private static PIDcreate()Create the PID for the current virtual mahcine.booleanequals(java.lang.Object obj)Check if the given object is equal to this PID.intgetID()Get the int process identifier.static PIDgetInstance()Get the PID for the current virtual machine.inthashCode()Return the hash code of this PID.java.lang.StringtoString()Return a string representation of this PID.java.lang.StringtoString(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:
toStringin 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:
hashCodein 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:
equalsin 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:
clonein 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.
-
-