org.objectweb.carol.cmi
Class StubData

java.lang.Object
  extended by org.objectweb.carol.cmi.StubData

public class StubData
extends java.lang.Object

Contains a stub to a single instance in the cluster of a clustered object and related data.

Author:
Simon Nieuviarts

Constructor Summary
StubData(ObjectId objectId, byte[] serStub, int factor)
          Creates a new stub
StubData(ObjectId objectId, java.rmi.Remote stub, int factor)
          Creates a new stub
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares an object with this one
 int getFactor()
           
 java.lang.String getKey()
           
 double getLoadIncr()
           
 ObjectId getObjectId()
          Get the ObjectId ref of the stub
 byte[] getSerializedStub()
          Get the serialized stub
 ClusterId getServerId()
          Get the server id associated with the stub
 java.rmi.Remote getStub()
          Get the Remote stub
 java.lang.Object getStubOrException()
          Get the stub
 int hashCode()
          Compute a hashcode for this
 void setKey(java.lang.String key)
          Set the key
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StubData

public StubData(ObjectId objectId,
                byte[] serStub,
                int factor)
         throws java.rmi.RemoteException
Creates a new stub

Parameters:
objectId - object identifier
serStub - serialized stub
factor - factor
Throws:
java.rmi.RemoteException - if prm are not allowed

StubData

public StubData(ObjectId objectId,
                java.rmi.Remote stub,
                int factor)
         throws java.rmi.RemoteException
Creates a new stub

Parameters:
objectId - object identifier
stub - Remote object stub
factor - factor
Throws:
java.rmi.RemoteException - if prm are not allowed
Method Detail

getServerId

public ClusterId getServerId()
Get the server id associated with the stub

Returns:
cluster id

getObjectId

public ObjectId getObjectId()
Get the ObjectId ref of the stub

Returns:
objectId

getSerializedStub

public byte[] getSerializedStub()
Get the serialized stub

Returns:
serialized buffer

getStub

public java.rmi.Remote getStub()
                        throws java.rmi.RemoteException
Get the Remote stub

Returns:
Remote object
Throws:
java.rmi.RemoteException - if stub can't be retrieved or not Remote object

getStubOrException

public java.lang.Object getStubOrException()
Get the stub

Returns:
Remote object
Throws:
java.rmi.RemoteException

getLoadIncr

public double getLoadIncr()
Returns:
load incr

getFactor

public int getFactor()
Returns:
factor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
readable form of the stub

hashCode

public int hashCode()
Compute a hashcode for this

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode

equals

public boolean equals(java.lang.Object obj)
Compares an object with this one

Overrides:
equals in class java.lang.Object
Parameters:
obj - object to compare
Returns:
true if equal, false otherwise

getKey

public java.lang.String getKey()
Returns:
get the key

setKey

public void setKey(java.lang.String key)
Set the key

Parameters:
key - jndi name associated with the object