Bonsoir,

je travaille sur un mini projet de réalisation d'un système de mise aux enchères à l'aides des objets distant (RMI) et les thread.

Pour réaliser ce système nous avons besoin de deux types d’objets distants un pour le vendeur et un pour les participants.

1. l’interface de l’objet distant qui gère le produit à vendre :
enregistrement : permet à un client de s’enregistrer en envoyant l’objet distant le représentant. En retour le client recevra un identifiant.
faireProposition permet à un participant de faire une proposition en précisant son identifiant et la valeur de la proposition.

2. L’interface de l’objet distant qui représente un participant est la suivante:
debutSession : informe un participant que la session numéro sid est ouverte avec comme prix de base.
finSession : informe un participant que la session sid est terminée.
finEnchereResultat : informe un participant de la fin de l’enchère avec le résultat concernant le participant comme paramètre.

j'ai implementé l'interface l’objet distant qui gère le produit à vendre , mais j'ai pas pu implémenté l’interface de l’objet distant qui représente un participant.

Merci de m'aider.

voici mon le code du premier interface:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
/**
 *
 * @author Bazoga
 */
public class EnchereImpl extends UnicastRemoteObject implements Enchere  {
 
    int prix ;
    Hashtable participants ;
    Hashtable propositions ;
    public static int nbParticipant ;
 
    public EnchereImpl() throws RemoteException {
            super();
            participants= new Hashtable();
            propositions = new Hashtable();
            nbParticipant=0;
    }
 
 
    public String enreg(Participant p) throws RemoteException {
        String id ;
        id = "participant"+nbParticipant ;
        participants.put(id, p);
        nbParticipant++;
        return id ;
 
    }
 
    public String descProduit() throws RemoteException {
            return "";
    }
 
    public float prixSession() throws RemoteException {
        return prix ;
    }
 
    public void faireProposition(String id, float proposition) throws RemoteException {
        if(participants.contains(id))
            this.propositions.put(id, proposition);
    }
 
 
}
E.Bazoga