lpr-b:esercizi
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| lpr-b:esercizi [04/12/2007 alle 22:20 (18 anni fa)] – Marco Danelutto | lpr-b:esercizi [07/12/2007 alle 10:02 (18 anni fa)] (versione attuale) – Marco Danelutto | ||
|---|---|---|---|
| Linea 281: | Linea 281: | ||
| * codice della classe [[datagrampacket|DatagramPacket]] | * codice della classe [[datagrampacket|DatagramPacket]] | ||
| | | ||
| + | |||
| + | |||
| + | |||
| Linea 298: | Linea 301: | ||
| Si faccia in modo che ciascuna delle operazioni dell' | Si faccia in modo che ciascuna delle operazioni dell' | ||
| + | |||
| + | |||
| + | === Soluzione proposta === | ||
| + | * Codice dell' | ||
| + | * Codice del [[CCremoto|CC remoto]] | ||
| + | * Codice del [[mainCCremote|main]] che pubblica l' | ||
| + | * Codice del [[clienteCC|cliente]] | ||
| + | |||
| ==== Asta RMI ==== | ==== Asta RMI ==== | ||
| + | Si realizzi un server che implementa il battitore di un' | ||
| + | Il cliente esegue un' | ||
| + | |||
| + | In particolare, | ||
| + | <code java> | ||
| + | public interface ClientInterface extends Remote { | ||
| + | public void offertaAvvenuta(int howMuch) throws RemoteException; | ||
| + | } | ||
| + | </ | ||
| + | e l' | ||
| + | <code java> | ||
| + | public interface InterfacciaBattitore extends Remote { | ||
| + | |||
| + | /** | ||
| + | * used to make an offer. | ||
| + | * @param name the name of who makes the offer | ||
| + | * @param howMuch the amount of the offer | ||
| + | * @return the current amount offered, 0 if the offer made is the currently accepted one | ||
| + | * @throws RemoteException | ||
| + | */ | ||
| + | public int offer(String name, int howMuch) throws RemoteException; | ||
| + | |||
| + | /** | ||
| + | * this is used to register the callback; | ||
| + | * @param name the name of who makes the offer | ||
| + | * @param cif | ||
| + | */ | ||
| + | public void register(String name, ClientInterface cif) throws RemoteException; | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | Purchè il meccanismo delle callback venga implementato correttamente, | ||
| + | |||
| + | Il dettaglio del comportamento di client e server, nonchè del metodo che sull' | ||
| + | |||
| + | {{lpr-b: | ||
| + | |||
| + | === Soluzione proposta === | ||
| + | * Interfaccia per l' | ||
| + | * Interfaccia del [[interfacciaBattitoreAsta|battitore]] | ||
| + | * Codice del [[clienteAsta|cliente]] (//fa offerte random iniziali finchè una non risulta vincente, poi aspetta notifiche dal battitore (tramite la callback) e nuove offerte da effettuare dal terminale// | ||
| + | * Codice del [[battitoreAsta|battitore]] | ||
| + | * Codice del [[mainBattitore|main]] che pubblica il battitore | ||
| + | |||
| | | ||
| [[lpr-b: | [[lpr-b: | ||
lpr-b/esercizi.1196806854.txt.gz · Ultima modifica: 04/12/2007 alle 22:20 (18 anni fa) da Marco Danelutto
