Code example for ScheduledThreadPoolExecutor

Methods: scheduleWithFixedDelay

0
	/** 
	 * 运行数据队列线程池 
	 * @param task ThreadMonitor 线程任务 
	 */ 
	public static void runTaskThread(ThreadMonitor task) {
		final ScheduledFuture<?> data = taskThread.scheduleWithFixedDelay(task, task.getInitialDelay(),task.getPeriod(),TimeUnit.SECONDS);
	} 
	 
	 
	/** 
	 * 运行线程池 
	 * @param task ThreadMonitor 线程任务 
	 */ 
	public static void runUrlTaskThread(ThreadMonitor task) {
		final ScheduledFuture<?> url = taskThread.scheduleWithFixedDelay(task, task.getInitialDelay(),task.getPeriod(),TimeUnit.SECONDS);
	} 
	 
	/** 
	 * 关闭线程任务 
	 */ 
Stop searching for code, let great code find you!  Add Codota to your java IDE