org.objectweb.carol.cmi
Class ClusterStubData
java.lang.Object
org.objectweb.carol.cmi.ClusterStubData
public class ClusterStubData
extends java.lang.Object
Stubs to clustered objects use this class. They may contain several
stubs to regular objects.
- Simon Nieuviarts
ClusterStubData(ClusterId serverId, byte[] stubSer, int factor) - Construct a new cluster stub data, containing a regular stub.
|
ClusterStubData
public ClusterStubData(ClusterId serverId,
byte[] stubSer,
int factor)
throws RemoteException
Construct a new cluster stub data, containing a regular stub.
serverId
- the cluster id of the server where the remote object is
running.stubSer
- the regular stub, serialized.factor
- factor for round robin load lalancing.
debug
public void debug(String mesg)
getClusterConfig
public ClusterConfig getClusterConfig()
You can assume it returns a non null structure if it is not
a stub to a cluster registry. cfg should have been initialized by
the constructor
getClusterStub
public ClusterStub getClusterStub()
throws RemoteException
getRandom
public StubLB getRandom()
getRoundRobin
public StubLB getRoundRobin()
isStubDebug
public boolean isStubDebug()
read
public static ClusterStubData read(ObjectInput in,
ClusterStub cs)
throws IOException,
ClassNotFoundException
Deserialize a ClusterStubData.
in
- input stream
- the object
removeStub
public boolean removeStub(ClusterId serverId)
This function fails if and only if the stub to remove is the last one.
removeStubData
public boolean removeStubData(StubData sd)
This function fails if and only if the stub to remove is the last one.
setStub
public boolean setStub(ClusterId serverId,
byte[] stubSer,
int factor)
Add a regular stub in this cluster stub.
serverId
- the cluster id of the server where the remote object
is running.
- false if the class of the stub is not the same the other objects
in the stub, or if factor is <321.
setStub
public boolean setStub(ClusterRegistryInternal stub)
Add a regular stub in this cluster stub.
Can be used only for the cluster registry.
stub
- a stub to a registry.
- false if the class of the stub is not the same the other objects
in the stub.
toContentsString
public String toContentsString()
toString
public String toString()
write
public void write(ObjectOutput out)
throws IOException
Serialize this object. Used by the encapsulating ClusterStub.
out
- the output stream