-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProcess.java
More file actions
55 lines (46 loc) · 1.36 KB
/
Process.java
File metadata and controls
55 lines (46 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package edu.bits.dc;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* This is a remote interface to access processes in distributed environment using Java Remote Method Invocation (RMI).
*/
public interface Process extends Remote {
/**
* This method tells if the process is alive and can participate in leader election.
* @return
* @throws RemoteException
*/
public boolean isAlive() throws RemoteException;
/**
* This method tells if the process in a leader in distributed environment.
* @return
* @throws RemoteException
*/
public boolean isLeader() throws RemoteException;
/**
* This method gets the logical clock value (random) for this process.
* @return
* @throws RemoteException
*/
public int getLogicalClock() throws RemoteException;
/**
* This method gets the process name, given during initialization.
* @return
* @throws RemoteException
*/
public String getProcessName() throws RemoteException;
/**
* This method gets called in election to compare the logical clock values.
* @param message
* @return
* @throws RemoteException
*/
public boolean inquiry(Message message) throws RemoteException;
/**
* This method is called to announce victory after the election.
* @param message
* @return
* @throws RemoteException
*/
public boolean victory(Message message) throws RemoteException;
}