org.objectweb.carol.cmi
Class StubData

java.lang.Object
  extended byorg.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()
           
 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
 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:
RemoteException, - if stub can't be retrieved or not Remote object
java.rmi.RemoteException

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()
Returns:
readable form of the stub

hashCode

public int hashCode()
Compute a hashcode for this

Returns:
hashcode

equals

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

Parameters:
obj - object to compare
Returns:
true if equal, false otherwise