jgroup.relacs.types
Class IIDImpl

java.lang.Object
  extended by jgroup.relacs.types.IIDImpl
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, IID

public final class IIDImpl
extends java.lang.Object
implements IID

Instances of this class uniquely identify invocations issued by a client. Each invocation identifier is composed of a virtual machine identifier, identifying the client, and a progressive counter used to distinguish among invocations performed by the same client.

Since:
Jgroup 0.9
Author:
Alberto Montresor
See Also:
Serialized Form

Constructor Summary
IIDImpl()
          Default public constructor for externalization.
IIDImpl(VMID vmid, int counter, int ack)
          Constructs a new invocation identifier.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two objects for content equality.
 int getAck()
          Returns ack information for this invocation identifier.
 int getCounter()
          Returns the sequential counter identifying this particular invocation.
 VMID getVmid()
          Returns the VMID of the (client) virtual machine that generated this invocation.
 int hashCode()
          Returns a hashcode for the IID.
 void readExternal(java.io.ObjectInput in)
          Restores the content of this object from the marshalled data contained in the specified input stream.
 java.lang.String toString()
          Returns a string representation of this object
 void writeExternal(java.io.ObjectOutput out)
          Write the content of this IID on stream out.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IIDImpl

public IIDImpl()
Default public constructor for externalization.


IIDImpl

public IIDImpl(VMID vmid,
               int counter,
               int ack)
Constructs a new invocation identifier.

Method Detail

getVmid

public VMID getVmid()
Returns the VMID of the (client) virtual machine that generated this invocation.

Specified by:
getVmid in interface IID

getCounter

public int getCounter()
Returns the sequential counter identifying this particular invocation.

Specified by:
getCounter in interface IID

getAck

public int getAck()
Returns ack information for this invocation identifier.


toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Returns a hashcode for the IID. Two IIDs will have the same hashcode if they are equal with respect to their content.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compares two objects for content equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with
Returns:
true if these objects are equal; false otherwise.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write the content of this IID on stream out. Note that method writeExternal of vmid is called, to improve the efficiency of this method.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to be written
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the content of this object from the marshalled data contained in the specified input stream.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to be read
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.