package scalableSearcher;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class SearcherClient {
	public static final int nT = 20;
	public static void main(String[] args) {
		try {       
			Searcher s = (Searcher)Naming.lookup("rmi://127.0.0.1/searcher");  
			Worker[] w = new Worker[nT];
			//
			long elapsedTime = System.currentTimeMillis();
			for(int i = 0; i < nT; i++)
				(w[i] = new Worker(s)).start();
			//
			for(int i = 0; i < nT; i++)
				w[i].join();
			elapsedTime = System.currentTimeMillis() - elapsedTime;
			System.out.println("Tempo totale: " +  elapsedTime + " ms");
			System.out.println("Throughput: " + (nT*Worker.nR*1000)/(double)elapsedTime + " req/s");
         
		} catch (NotBoundException e) {      
			System.err.println("Request obect not bound "+ e); 
		} catch (MalformedURLException e) {   
			System.err.println("Wrong URL" + e); 
		} catch (RemoteException e) {      
			System.err.println("Network or Server Error" + e);  
		} catch (InterruptedException e) {
			e.printStackTrace();
		}   
	}
}

class Worker extends Thread{
	public static final int nR = 50;
	public Searcher s;
	public Worker(Searcher s){
		this.s = s;
	}
	public void run(){
		//
		long elapsedTime = System.currentTimeMillis();
		for(int i = 0; i < nR; i++){
			try {
				boolean result = s.findObject(i);
				//(result) System.out.println("i: " + found");
			} catch (RemoteException e) {
				e.printStackTrace();
			}
		}
		//
		elapsedTime = System.currentTimeMillis() - elapsedTime;
		System.out.println("Elaborazione locale al thread: " + this + " in " + elapsedTime + " ms");
		System.out.println("Tempo di risposta medio: " + elapsedTime/(double)nR + " ms");
	}
}
@@ -1410,19 +1410,8 @@
 %09%09%09%09
-//(result) 
 Syst
@@ -1430,21 +1430,52 @@
 ln(%22
-i: %22 + found%22
+Object with key %22 + i + %22 exists: %22 + result
 );%0A%09

Edit SearcherClient so that it prints which object are found and which not.