lpr-b:stampatoretermina
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; } } } }
lpr-b/stampatoretermina.txt · Ultima modifica: 05/10/2007 alle 18:16 (17 anni fa) da Marco Danelutto