org.objectweb.carol.cmi
Class StubConfig

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

public class StubConfig
extends java.lang.Object

Used to get information on a remote object. Searches for CMI configuration information association with the remote class.

Author:
Simon Nieuviarts
See Also:
Distributor

Method Summary
static void checkClusterStub(java.lang.Class remoteObjClass, ClusterStub cs)
          Check the compatibility between the cluster stub and a remote object class
static java.lang.Boolean clusterEquivAtBind(java.rmi.Remote obj)
          Test if the object is a CMI stub
static java.lang.String clusterEquivAtExport(java.rmi.Remote obj)
          Test if the object is to be clustered and if it has to be advertised at export().
static ClusterStub instanciateClusterStub(java.lang.Class remoteObjClass, ServerStubList stubList)
           
static ClusterStub instanciateClusterStub(java.lang.Class remoteObjClass, StubData stubData)
          Create a ClusterStub with only one StubData
static void main(java.lang.String[] args)
          For test purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clusterEquivAtBind

public static java.lang.Boolean clusterEquivAtBind(java.rmi.Remote obj)
                                            throws StubConfigException
Test if the object is a CMI stub

Returns:
true if the object is a CMI stub, false otherwise
Throws:
StubConfigException

clusterEquivAtExport

public static java.lang.String clusterEquivAtExport(java.rmi.Remote obj)
                                             throws StubConfigException
Test if the object is to be clustered and if it has to be advertised at export(). Return the name to use.

Parameters:
obj - remote object
Returns:
null if the object is not clustered.
Throws:
StubConfigException - if config error

checkClusterStub

public static void checkClusterStub(java.lang.Class remoteObjClass,
                                    ClusterStub cs)
                             throws java.rmi.RemoteException
Check the compatibility between the cluster stub and a remote object class

Parameters:
remoteObjClass - remote object class
cs - cluster stub
Throws:
java.rmi.RemoteException - if the stub aren't compliant

instanciateClusterStub

public static ClusterStub instanciateClusterStub(java.lang.Class remoteObjClass,
                                                 ServerStubList stubList)
                                          throws StubConfigException
Parameters:
remoteObjClass - remote object class
stubList - stubs list
Returns:
a cluster stub corresponding to the parameter class
Throws:
StubConfigException - if exception during instanciation of the stub class

instanciateClusterStub

public static ClusterStub instanciateClusterStub(java.lang.Class remoteObjClass,
                                                 StubData stubData)
                                          throws StubConfigException
Create a ClusterStub with only one StubData

Parameters:
remoteObjClass - remote object class
stubData - stub data
Returns:
a cluster stub corresponding to the parameter class
Throws:
StubConfigException - if exception during instanciation of the stub class

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
For test purposes

Parameters:
args - program args
Throws:
java.lang.Exception - if an error occurs