org.jboss.util.platform
Class PID

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

public class PID
extends Object
implements Serializable, 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: 1.1.28.2 $
Author:
Jason Dillon
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
 Object clone()
          Returns a copy of this PID.
 boolean equals(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.
 String toString()
          Return a string representation of this PID.
 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 String toString()
Return a string representation of this PID.

Overrides:
toString in class Object
Returns:
A string representation of this PID.

toString

public 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.

Overrides:
hashCode in class Object
Returns:
The hash code of this PID.

equals

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

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

clone

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

Overrides:
clone in class Object
Returns:
A copy of this PID.

getInstance

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

Returns:
Process identifier.


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