Code example for ScheduledExecutorService

Methods: schedule

0
			return; 
		} 
 
		ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
 
		service.schedule(new AsyncCleanup(service), delay, timeUnit);
	} 
 
	protected class AsyncCleanup implements Runnable, ThreadFactory
	{ 
		protected ExecutorService service;
 
		public AsyncCleanup(ExecutorService service)
		{ 
			this.service = service;
		} 
 
		// TODO @Override 
		public void run() 
		{ 
			doCleanTempDir();