org.objectweb.dream.protocol.utobcast
Interface ProcessMembership

All Known Implementing Classes:
ProcessMembershipImpl

public interface ProcessMembership

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

ITF_NAME

public static final String ITF_NAME
The commonly used name to refer to this interface.

See Also:
Constant Field Values
Method Detail

getLeader

public Process getLeader()
                  throws InterruptedException
Returns the leader process.

Returns:
the leader process.
Throws:
InterruptedException - if the component is interrupted while waiting for a leader to be elected.

setLeader

public void setLeader(Process leader)
Sets the leader process.

Parameters:
leader - the leader to set.

getBackup

public Process getBackup()
                  throws InterruptedException
Returns the backup process.

Returns:
the backup process.
Throws:
InterruptedException - if the component is interrupted while waiting for a backup to be elected.

setBackup

public void setBackup(Process backup)
Sets the backup process.

Parameters:
backup - the backup to set.

getMyself

public Process getMyself()
                  throws InterruptedException
Returns the process to which this process membership component belongs.

Returns:
the process to which this process membership component belongs.
Throws:
InterruptedException - if the component is interrupted while waiting for knowing its identity.

setMyself

public void setMyself(Process myself)
Sets the process to which this process membership component belongs.

Parameters:
myself - the process to set.

getOtherProcesses

public Process[] getOtherProcesses()
Returns an array containing all the processes except backup and leader processes.

Returns:
all the processes except backup and leader processes.

setOtherProcesses

public void setOtherProcesses(Process[] processes)
Sets the processes to be considered for broadcast (except backup and leader).

Parameters:
processes - all the processes except backup and leader processes.

addProcess

public void addProcess(Process process)
Adds a process to the group of processes.

Parameters:
process - the process to be added.

removeProcess

public void removeProcess(Process process)
Removes a process from the group of processes.

Parameters:
process - the process to be removed.

electBackup

public Process electBackup()
                    throws InterruptedException
Elects a new backup process. Returns null if no process is available for being elected.

Returns:
the elected backup, null if no process is available.
Throws:
InterruptedException - if the component is interrupted while waiting for a process to be added in the group.

electBackupAsLeader

public Process electBackupAsLeader(Process oldLeader)
Elects the backup as new leader provided the curerntly registered leader is the one given in parameter. Otherwise, don't do anything.

Parameters:
oldLeader - the process that were supposed to be the old leader.
Returns:
the new leader.


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.