首页 > 代码库 > ScheduleFactory(不同scheduler name)
ScheduleFactory(不同scheduler name)
package com.unis.uvm.quartz; import java.util.Properties; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.impl.StdSchedulerFactory; /** * Scheduler Factory: used to create a scheduler * * @author xpz * @version [version, Nov 17, 2014] * @see [about class/method] * @since [product/module version] */ public class ScheduleFactory { private static Scheduler scheduler = null; private ScheduleFactory() { } /*** * get scheduler instance * * @return [explain parameter] * @return Scheduler [explain return type] * @throws SchedulerException * @exception throws [exception type] [explain exception] * @see [class,class#method,class#member] */ public static Scheduler getScheduler(String threadName) throws SchedulerException { if (scheduler == null) { StdSchedulerFactory sf = new StdSchedulerFactory( "quartz.properties"); Properties pros = new Properties(); pros.put("org.quartz.scheduler.instanceName", threadName); pros.put("org.quartz.threadPool.threadCount", "10"); sf.initialize(pros); scheduler = sf.getScheduler(); } return scheduler; } }
ScheduleFactory(不同scheduler name)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。