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;
|
package linda;
|
||||||
|
|
||||||
|
import java.rmi.Remote;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/** Public interface to a Linda implementation.
|
/** Public interface to a Linda implementation.
|
||||||
|
|
|
@ -3,7 +3,6 @@ package linda.server;
|
||||||
import linda.Callback;
|
import linda.Callback;
|
||||||
import linda.Linda;
|
import linda.Linda;
|
||||||
import linda.Tuple;
|
import linda.Tuple;
|
||||||
import linda.shm.CentralizedLinda;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.rmi.*;
|
import java.rmi.*;
|
||||||
|
@ -19,12 +18,11 @@ public class LindaClient implements Linda {
|
||||||
Linda lindaServer;
|
Linda lindaServer;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
LindaClient lc = new LindaClient(args[0]);
|
||||||
LindaServer ls = (LindaServer) Naming.lookup(args[0]);
|
|
||||||
|
|
||||||
Tuple t1 = new Tuple(1, "a");
|
Tuple t1 = new Tuple(1, "a");
|
||||||
System.out.print("Tuple " + t1 + " envoyé");
|
System.out.print("Tuple " + t1 + " envoyé");
|
||||||
ls.write(t1);
|
lc.write(t1);
|
||||||
System.out.print("Tuple " + t1 + " écrit");
|
System.out.print("Tuple " + t1 + " écrit");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -35,12 +33,9 @@ public class LindaClient implements Linda {
|
||||||
|
|
||||||
Tuple template = new Tuple(Integer.class, String.class);
|
Tuple template = new Tuple(Integer.class, String.class);
|
||||||
System.out.print("Lecture " + template + " envoyé");
|
System.out.print("Lecture " + template + " envoyé");
|
||||||
Tuple t2 = ls.read(template);
|
Tuple t2 = lc.read(template);
|
||||||
System.out.print("Tuple " + t2 + " lu");
|
System.out.print("Tuple " + t2 + " lu");
|
||||||
|
|
||||||
} catch (MalformedURLException | RemoteException | NotBoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue