package threadPoolConTerminazione;
 
 
public class Stampatore<T> extends Thread {
 
	Repository<T> rep;
 
	public Stampatore(Repository<T> results) {
		this.rep = results; 
	}
 
	public void run() {
		while(true) {
			T i;
			try {
				i = rep.extract();
				System.out.println("Estratto "+i.toString());
			} catch (EndOfStreamException e) {
				e.printStackTrace();
			} catch (InterruptedException e) {
				// fine lavori 
				return;
			}
 
		}
	}
}