|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
darx.NameServerImpl
class NameServerImpl
This is the name server implementation which provides the means for locating replication group leaders.
Field Summary | |
---|---|
protected static int |
PORT_NB
The port number of the location of the centralized name server. |
protected static java.lang.String |
URL
The URL of the location of the centralized name server. |
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Fields inherited from interface darx.NameServer |
---|
DEFAULT_PORT_NB, DEFAULT_URL, SERVICE_NAME |
Constructor Summary | |
---|---|
NameServerImpl()
Constructor... |
Method Summary | |
---|---|
(package private) static void |
analyseCommandLine(java.lang.String[] params)
Analyses the command line in order to fill in specific runtime info: the port number of the name server if the default value is not used, and whether the name server is in debug (verbose) mode or not. |
ReplicantInfo |
getLeaderOfTask(java.lang.String task_name)
Returns the information necessary for obtaining the handle of the current leader of the given replication group. |
static void |
main(java.lang.String[] p)
|
void |
register(ReplicantInfo new_replicant)
Registers the info concerning a new replicant for a given task. |
ReplicantInfo |
selectAnotherLeader(ReplicantInfo old_leader)
Sets a replicant as the new leader within its replication group info. |
void |
setLeaderOfTask(ReplicantInfo rep_info)
Selects a replicant as the new leader within its replication group info. |
ReplicantInfo |
setLeaderOfTask(java.lang.String url,
int port_nb,
java.lang.String task_name)
Selects a replicant as the new leader within its replication group info. |
(package private) static void |
setPortNumber(java.lang.String port_number)
Modifier for the PORT_NUMBER of the name server. |
(package private) static void |
setURL(java.lang.String url)
Modifier for the URL of the name server. |
ReplicantInfo |
unregister(java.lang.String task_name,
java.lang.String url,
int port_nb)
Removes the info concerning a replicant for a given task. |
ReplicationGroupInfo |
unregisterGroup(java.lang.String task_name)
Removes the info concerning a whole replication group for a given task. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String URL
protected static int PORT_NB
Constructor Detail |
---|
NameServerImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
static void setURL(java.lang.String url)
static void setPortNumber(java.lang.String port_number)
public ReplicantInfo getLeaderOfTask(java.lang.String task_name) throws java.rmi.RemoteException, NoMoreReplicantsException, InexistentNameException
getLeaderOfTask
in interface NameServer
task_name
- the generic task name
java.rmi.RemoteException
NoMoreReplicantsException
InexistentNameException
public ReplicantInfo selectAnotherLeader(ReplicantInfo old_leader) throws java.rmi.RemoteException, NoMoreReplicantsException, InexistentNameException
selectAnotherLeader
in interface NameServer
old_leader
- the info defining the leader to be replaced
java.rmi.RemoteException
NoMoreReplicantsException
InexistentNameException
public void setLeaderOfTask(ReplicantInfo rep_info) throws InexistentNameException, java.rmi.RemoteException, UnknownReplicantException
setLeaderOfTask
in interface NameServer
rep_info
- the info about the replicant to be set as the new leader
InexistentNameException
- No replication group corresponds to
the task the replicant info claims to
represent.
java.rmi.RemoteException
- RMI general problem
UnknownReplicantException
- The given replicant info hasn't been
registered before.public ReplicantInfo setLeaderOfTask(java.lang.String url, int port_nb, java.lang.String task_name) throws InexistentNameException, java.rmi.RemoteException, UnknownReplicantException
setLeaderOfTask
in interface NameServer
url
- the URL of the replicant to be set as new leaderport_nb
- the port nb of the replicant to be set as new leadertask_name
- the generic name of the concerned task
InexistentNameException
- No replication group corresponds to
the task the replicant info claims to
represent.
java.rmi.RemoteException
- RMI general problem
UnknownReplicantException
- The given replicant info hasn't been
registered before.public void register(ReplicantInfo new_replicant) throws java.rmi.RemoteException
register
in interface NameServer
new_replicant
- the replicant info to register
java.rmi.RemoteException
public ReplicantInfo unregister(java.lang.String task_name, java.lang.String url, int port_nb) throws java.rmi.RemoteException, UnknownReplicantException, InexistentNameException
unregister
in interface NameServer
task_name
- the name of the task to which the replicant belongsurl
- the url of the server hosting the doomed replicaport_nb
- the port nb of the server hosting the doomed replica
java.rmi.RemoteException
UnknownReplicantException
InexistentNameException
public ReplicationGroupInfo unregisterGroup(java.lang.String task_name) throws java.rmi.RemoteException, InexistentNameException
unregisterGroup
in interface NameServer
task_name
- the name of the task being stopped
java.rmi.RemoteException
InexistentNameException
public static void main(java.lang.String[] p)
static void analyseCommandLine(java.lang.String[] params)
params
- the String array containing the parameters, can be void
if default values are used and debug mode is off
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |