package com.changhong.epc.parsing.service.loop.tools; import com.changhong.epc.parsing.service.loop.tools.thread.MyThread; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class TimerHandle { private static final ExecutorService executorService = Executors.newCachedThreadPool(); /** * 执行线程 * @Title: timer * @param @param thread * @param @param time 设定文件 * @return void 返回类型 * @throws */ public static void timer(Thread thread){ executorService.execute(thread); } /** * 获得线程实例 * @Title: createThread * @param @param perform * @param @param threadName * @param @param time * @param @return 设定文件 * @return Thread 返回类型 * @throws */ public static MyThread createThread(Perform perform, String threadName, long time){ return new MyThread(perform, threadName, time); } }