public class ServiceListener implements Runnable,ActionListener....public void run() {.... if (processor.getClass()==SMTPProcessor.class) { ((SMTPProcessor)processor).addActionEventListener(this); } //Create, name, and start a new thread to handle this request. threadPool[index] = new Thread(processor, threadNameBase + ":" + ++threadCount ); threadPool[index].start();....}.... public void actionPerformed(ActionEvent arg0) { System.out.println("UN NOUVEAU MAIL VIENT D'ARRIVER !!!!"); }}