Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisione Revisione precedente Prossima revisione | Revisione precedente | ||
lpr-b-2007-2008:esercizi [28/11/2007 alle 08:12 (17 anni fa)] Marco Danelutto |
lpr-b-2007-2008:esercizi [19/09/2008 alle 14:08 (16 anni fa)] (versione attuale) |
||
---|---|---|---|
Linea 281: | Linea 281: | ||
* codice della classe [[datagrampacket|DatagramPacket]] | * codice della classe [[datagrampacket|DatagramPacket]] | ||
| | ||
+ | |||
+ | |||
+ | |||
+ | |||
==== ContoCorrente RMI ==== | ==== ContoCorrente RMI ==== | ||
Linea 297: | 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 ==== | ||
+ | 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: |