⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cronruntime.java

📁 电信的网厅的整站代码
💻 JAVA
字号:
package com.doone.fj1w.common;

import java.util.Timer;
import com.doone.fj1w.fjmgr.SendinfoService;
import com.doone.util.FileLogger;

public class CronRuntime {
	private static java.util.Timer timer = null;

	protected void finalize() throws Throwable {
		super.finalize();
		// 关闭所有连接。
		try {
			timer.cancel();
			timer = null;
		} catch (Throwable e) {
			FileLogger.getLogger().error("中断定时任务出错。", e);
		}
	}

	public static void init() {
		if (timer == null)
		{
			// 启动1分钟一次的定时处理任务。
			timer = new Timer(true);
			timer.schedule(new SendinfoService(), 0, 60000);
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -