25 lines
495 B
Java
25 lines
495 B
Java
|
import java.rmi.*;
|
||
|
import java.rmi.server.*;
|
||
|
import java.io.*;
|
||
|
import java.util.*;
|
||
|
|
||
|
public class ObjetDe extends UnicastRemoteObject implements ObjetDeItf {
|
||
|
|
||
|
private Random de;
|
||
|
private int calls;
|
||
|
|
||
|
public ObjetDe() throws RemoteException {
|
||
|
de = new Random();
|
||
|
calls = 0;
|
||
|
}
|
||
|
|
||
|
public int getRandom() throws RemoteException {
|
||
|
calls++;
|
||
|
return 1 + de.nextInt(6);
|
||
|
}
|
||
|
|
||
|
public int getCalls() throws RemoteException {
|
||
|
return calls;
|
||
|
}
|
||
|
}
|