c pété
Co-authored-by: gdamms <gdamms@users.noreply.github.com>
This commit is contained in:
parent
e414adca3b
commit
4a7bd702d3
|
@ -1,5 +1,6 @@
|
|||
package linda;
|
||||
|
||||
import java.rmi.Remote;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Public interface to a Linda implementation.
|
||||
|
|
|
@ -3,7 +3,6 @@ package linda.server;
|
|||
import linda.Callback;
|
||||
import linda.Linda;
|
||||
import linda.Tuple;
|
||||
import linda.shm.CentralizedLinda;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.rmi.*;
|
||||
|
@ -19,28 +18,24 @@ public class LindaClient implements Linda {
|
|||
Linda 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 {
|
||||
LindaServer ls = (LindaServer) Naming.lookup(args[0]);
|
||||
|
||||
Tuple t1 = new Tuple(1, "a");
|
||||
System.out.print("Tuple " + t1 + " envoyé");
|
||||
ls.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 = ls.read(template);
|
||||
System.out.print("Tuple " + t2 + " lu");
|
||||
|
||||
} catch (MalformedURLException | RemoteException | NotBoundException e) {
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue