I am using ExecutorService. Following is the code
public class A{
public static void main(String args[]){
ExecutorService executorService = Executors.newFixedThreadPool(5);
Runnable worker = new FileUploadThread("thread");
executorService.execute(worker);
}
}
public class FileuploadThread extends Thread{
//has a parametrized constuctor
@Override
public void run(){
for(int i=0; i<10000; i++){
syso("executing...");
}
}
}
I want to receive an event or something in the main method when the thread completes it task. How can i do that ?