lpr-b-2007-2008: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 [27/11/2007 alle 21:47 (18 anni fa)] – Marco Danelutto | lpr-b-2007-2008:esercizi [19/09/2008 alle 14:08 (17 anni fa)] (versione attuale) – modifica esterna 127.0.0.1 | ||
|---|---|---|---|
| Linea 270: | Linea 270: | ||
| * [[copyout|thread copiatore (tastiera -> pacchetto)]] | * [[copyout|thread copiatore (tastiera -> pacchetto)]] | ||
| * [[mainchat|main]] | * [[mainchat|main]] | ||
| + | |||
| Linea 280: | Linea 281: | ||
| * codice della classe [[datagrampacket|DatagramPacket]] | * codice della classe [[datagrampacket|DatagramPacket]] | ||
|    |    | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==== ContoCorrente RMI ==== | ||
| + | Si realizzi un oggetto ContoCorrente e lo si renda accessibile da remoto utilizzando la tecnologia RMI, che permetta di effettuare operazioni di | ||
| + |    | ||
| + |   long saldo()  | ||
| + |   long prelievo(long cifra)  | ||
| + |   long deposito(long cifra)  | ||
| + | String ultimiMovimenti(int n) // restituisce gli ultimi n movimenti, uno per riga | ||
| + | |||
| + | Si realizzino: | ||
| + |     * un' | ||
| + |     * l' | ||
| + |     * un main che crea il registry e pubblica l' | ||
| + |     * un cliente che accetta come parametri dalla riga di comando il nome 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: | ||
lpr-b-2007-2008/esercizi.1196200062.txt.gz · Ultima modifica: 19/09/2008 alle 14:08 (17 anni fa) (modifica esterna)
                
                