Advertisement
amine99

Untitled

Feb 3rd, 2020
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. //Client
  2.  
  3. package client;
  4. import java.rmi.Naming;
  5. import java.rmi.RemoteException;
  6. import barriere.Barriere;
  7. import barriere.BarriereInt;
  8.  
  9. public class Client extends Barriere {
  10.    
  11.     public Client() throws RemoteException {
  12.         super();
  13.     }
  14.    
  15.     public static void main(String[] args) {
  16.         try {
  17.             BarriereInt b = (BarriereInt)Naming.lookup("rmi://localhost:1099/barriere");
  18.             if(b.entre()) {
  19.                 System.out.println("Entree Success");
  20.             } else {
  21.                 System.out.println("FULL");
  22.             }
  23.         } catch (Exception e) {
  24.             System.out.println(e.toString());
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement