lpr-b:battitoreasta
no way to compare when less than two revisions
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
— | lpr-b:battitoreasta [07/12/2007 alle 09:55 (18 anni fa)] (versione attuale) – creata Marco Danelutto | ||
---|---|---|---|
Linea 1: | Linea 1: | ||
+ | <code java> | ||
+ | package astaRMI; | ||
+ | import java.rmi.RemoteException; | ||
+ | import java.rmi.server.UnicastRemoteObject; | ||
+ | import java.util.HashMap; | ||
+ | import java.util.Iterator; | ||
+ | |||
+ | public class Battitore extends UnicastRemoteObject implements InterfacciaBattitore | ||
+ | |||
+ | protected Battitore() throws RemoteException { | ||
+ | super(); | ||
+ | } | ||
+ | |||
+ | private static final long serialVersionUID = -8624867101274666805L; | ||
+ | |||
+ | int offertaCorrente = 0; | ||
+ | String vincitore = ""; | ||
+ | HashMap< | ||
+ | |||
+ | public synchronized int offer(String name, int howMuch) throws RemoteException { | ||
+ | System.out.println(" | ||
+ | if(howMuch > offertaCorrente) | ||
+ | { | ||
+ | offertaCorrente = howMuch; | ||
+ | vincitore = name; | ||
+ | System.out.println(" | ||
+ | Iterator< | ||
+ | while(it.hasNext()) { | ||
+ | ClientInterface ci = (ClientInterface) it.next(); | ||
+ | ci.offer(offertaCorrente); | ||
+ | } | ||
+ | } | ||
+ | return offertaCorrente; | ||
+ | } | ||
+ | |||
+ | public void register(String name, ClientInterface cif) throws RemoteException { | ||
+ | System.out.println(" | ||
+ | clienti.put(name, | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ |
lpr-b/battitoreasta.txt · Ultima modifica: 07/12/2007 alle 09:55 (18 anni fa) da Marco Danelutto