org.objectweb.carol.cmi
Class RegistryStubList

java.lang.Object
  extended byorg.objectweb.carol.cmi.RegistryStubList

public class RegistryStubList
extends java.lang.Object

A container of regular stubs to CMI registries.

Author:
Simon Nieuviarts

Method Summary
static void debug(java.lang.String mesg)
          Print a bug message on the console
static org.objectweb.carol.cmi.RegistryInternal getClusterStub(NamingContextHostPort[] hp)
          Get a reference to the Cluster registry
 java.util.Set getSetOfStubs()
          Get the set of stubs
 boolean isStubDebug()
          Test is the debug mode is enabled
static RegistryStubList read(java.io.ObjectInput in)
          Read stubs from input
 boolean removeStub(StubData sd)
          Remove a stub This function fails if and only if the stub to remove is the last one.
 java.lang.String toContentsString()
          Pretty print for the stubs list
 java.lang.String toString()
          Get the String form of this
 void write(java.io.ObjectOutput out)
          Write stubs to output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

write

public void write(java.io.ObjectOutput out)
           throws java.io.IOException
Write stubs to output

Parameters:
out - output stream
Throws:
java.io.IOException - if exception occurs

read

public static RegistryStubList read(java.io.ObjectInput in)
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Read stubs from input

Parameters:
in - input stream
Returns:
stubs list
Throws:
java.io.IOException - if I/O error is encountered
java.lang.ClassNotFoundException - if the class INF

removeStub

public boolean removeStub(StubData sd)
Remove a stub This function fails if and only if the stub to remove is the last one. XXX No consistent with the way it works in ServerStubList.

Parameters:
sd - stub
Returns:
true if the stub has been removed, false otherwise

getClusterStub

public static org.objectweb.carol.cmi.RegistryInternal getClusterStub(NamingContextHostPort[] hp)
                                                               throws java.rmi.RemoteException
Get a reference to the Cluster registry

Parameters:
hp - host and port of the naming context
Returns:
registry reference
Throws:
java.rmi.RemoteException - if an exception is encountered

getSetOfStubs

public java.util.Set getSetOfStubs()
Get the set of stubs

Returns:
set of stubs

isStubDebug

public boolean isStubDebug()
Test is the debug mode is enabled

Returns:
true is enable, false otherwise

debug

public static void debug(java.lang.String mesg)
Print a bug message on the console

Parameters:
mesg - message to print

toContentsString

public java.lang.String toContentsString()
Pretty print for the stubs list

Returns:
String stubs list

toString

public java.lang.String toString()
Get the String form of this

Returns:
String String view of the instance