org.objectweb.carol.cmi
Class ServerIdFactory

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

public class ServerIdFactory
extends java.lang.Object

The aim of this class is to generate unique IDs to identify an instance of a clustered server. The IDs generated by this class are guaranteed to be unique on the whole network. To generate an ID, time may be needed, because they can be generated by locking a well know resource for a period of time.

Author:
Simon Nieuviarts

Method Summary
static ClusterId getServerId()
          Get the local cluster Id.
static ServerIdFactory getServerIdFactory()
          Get the factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServerIdFactory

public static ServerIdFactory getServerIdFactory()
                                          throws ServerConfigException
Get the factory

Returns:
ServerIdFactory factory
Throws:
ServerConfigException - if the local id can not be built

getServerId

public static ClusterId getServerId()
                             throws ServerConfigException
Get the local cluster Id.

Returns:
the cluster Id
Throws:
ServerConfigException - if the id cannot be built