Example #1
0
 /** start_notification */
 public synchronized void start_notification() throws RemoteException {
   JOptionPane.showMessageDialog(
       null,
       "Le serveur est connecté de nouveau",
       "Notification du client",
       JOptionPane.INFORMATION_MESSAGE);
   srv_state = true;
   try {
     for (int i = 0; i < J.getnbrcon(); i++) {
       if (J.list_con()[i].compareTo(C.get_nom()) != 0) {
         C.ajout(J.list_con()[i]);
       }
     }
   } catch (RemoteException ex) {
   }
 }
Example #2
0
 /** close_notification */
 public synchronized void close_notification() throws RemoteException {
   JOptionPane.showMessageDialog(
       null,
       "Le serveur est injoignable pour le moment",
       "Erreur distante",
       JOptionPane.INFORMATION_MESSAGE);
   srv_state = false;
   C.initialiser();
 }
Example #3
0
  public static void main(String argv[]) {

    if (argv.length != 1) {
      System.out.println("java Irc <name>");
      return;
    }
    myName = argv[0];

    // initialize the system
    Client.init();

    // look up the IRC object in the name server
    // if not found, create it, and register it in the name server
    Sentence_itf s = (Sentence_itf) Client.lookup("IRC");
    if (s == null) {
      s = (Sentence_itf) Client.create(new Sentence());
      Client.register("IRC", s);
    }
    // create the graphical part
    new Irc(s);
  }
Example #4
0
 // ______________________________________Méthode qui met à jour la liste des messages recues d'un
 // client
 public synchronized void updatemsgs(Communication com) throws RemoteException {
   C.update("[" + com.get_src() + "] : " + com.get_msg());
 }
Example #5
0
 // ______________________________________Méthode qui met à jour la liste des destinataires d'un
 // client
 public synchronized void clidisconnect(String nom) throws RemoteException {
   C.supp(nom);
 }
Example #6
0
 // ______________________________________Méthode qui met à jour la liste des destinataires d'un
 // client lors de la connexion d'un nouveau client
 public synchronized void newcliConnexion(String nom) throws RemoteException {
   C.ajout(nom);
 }
Example #7
0
 public static void main(String[] args) {
   Client client = new Client();
   client.connect();
   SomeBean msg = client.getBeanFromServer();
   System.out.println(msg.getValue());
 }