public static void main(String[] args) throws Exception {
		ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors
				.newCachedThreadPool();
		
		Random random = new Random();
		for (int i=0; i<10; i++) {
			Task task = new Task(random.nextInt(10000));
			executor.submit(task);
		}
		
		for (int i=0; i<5; i++) {
			showLog(executor);
			TimeUnit.SECONDS.sleep(1);
		}
		
		System.out.println("Shut down the executor!!!");
		executor.shutdown();
		
		for (int i=0; i<5; i++) {
			showLog(executor);
			TimeUnit.SECONDS.sleep(1);
		}
		
		executor.awaitTermination(1, TimeUnit.MINUTES);
		
		System.out.println("Main: end of the program.");
		
		
	}