|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines methods for managing a group of processes.
Field Summary | |
static String |
ITF_NAME
The commonly used name to refer to this interface. |
Method Summary | |
void |
addProcess(Process process)
Adds a process to the group of processes. |
Process |
electBackup()
Elects a new backup process. |
Process |
electBackupAsLeader(Process oldLeader)
Elects the backup as new leader provided the curerntly registered leader is the one given in parameter. |
Process |
getBackup()
Returns the backup process. |
Process |
getLeader()
Returns the leader process. |
Process |
getMyself()
Returns the process to which this process membership component belongs. |
Process[] |
getOtherProcesses()
Returns an array containing all the processes except backup and leader processes. |
void |
removeProcess(Process process)
Removes a process from the group of processes. |
void |
setBackup(Process backup)
Sets the backup process. |
void |
setLeader(Process leader)
Sets the leader process. |
void |
setMyself(Process myself)
Sets the process to which this process membership component belongs. |
void |
setOtherProcesses(Process[] processes)
Sets the processes to be considered for broadcast (except backup and leader). |
Field Detail |
public static final String ITF_NAME
Method Detail |
public Process getLeader() throws InterruptedException
InterruptedException
- if the component is interrupted while waiting
for a leader to be elected.public void setLeader(Process leader)
leader
- the leader to set.public Process getBackup() throws InterruptedException
InterruptedException
- if the component is interrupted while waiting
for a backup to be elected.public void setBackup(Process backup)
backup
- the backup to set.public Process getMyself() throws InterruptedException
InterruptedException
- if the component is interrupted while waiting
for knowing its identity.public void setMyself(Process myself)
myself
- the process to set.public Process[] getOtherProcesses()
public void setOtherProcesses(Process[] processes)
processes
- all the processes except backup and leader processes.public void addProcess(Process process)
process
- the process to be added.public void removeProcess(Process process)
process
- the process to be removed.public Process electBackup() throws InterruptedException
null
if no process is
available for being elected.
null
if no process is available.
InterruptedException
- if the component is interrupted while waiting
for a process to be added in the group.public Process electBackupAsLeader(Process oldLeader)
oldLeader
- the process that were supposed to be the old leader.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |