fix: pas besoin de main dans le server et le client

This commit is contained in:
gdamms 2021-12-02 22:40:20 +01:00
parent f2d318d3f7
commit 85e8629816
2 changed files with 0 additions and 33 deletions

View file

@ -17,28 +17,6 @@ public class LindaClient implements Linda {
LindaRemote lindaServer;
public static void main(String[] args) {
LindaClient lc = new LindaClient(args[0]);
Tuple t1 = new Tuple(1, "a");
System.out.print("Tuple " + t1 + " envoyé");
lc.write(t1);
System.out.print("Tuple " + t1 + " écrit");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Tuple template = new Tuple(Integer.class, String.class);
System.out.print("Lecture " + template + " envoyé");
Tuple t2 = lc.read(template);
System.out.print("Tuple " + t2 + " lu");
}
/**
* Initializes the Linda implementation.
*

View file

@ -18,17 +18,6 @@ public class LindaServer extends UnicastRemoteObject implements LindaRemote {
Linda lindaInstance;
public static void main(String[] args) {
try {
LindaServer ls = new LindaServer();
LocateRegistry.createRegistry(Integer.parseInt(args[1]));
Naming.rebind(args[0], ls);
System.out.println("L'instance Linda a été publié sur le registre (" + args[0] + ") !\n");
} catch (Exception e) {
e.printStackTrace();
}
}
public LindaServer() throws RemoteException {
this.lindaInstance = new CentralizedLinda();
}