• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MutableTrigger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.quartz.spi.MutableTrigger的典型用法代码示例。如果您正苦于以下问题:Java MutableTrigger类的具体用法?Java MutableTrigger怎么用?Java MutableTrigger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MutableTrigger类属于org.quartz.spi包,在下文中一共展示了MutableTrigger类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Produce the <code>Trigger</code>.
 * 
 * @return a Trigger that meets the specifications of the builder.
 */
@SuppressWarnings("unchecked")
public T build() {

    if(scheduleBuilder == null)
        scheduleBuilder = SimpleScheduleBuilder.simpleSchedule();
    MutableTrigger trig = scheduleBuilder.build();
    
    trig.setCalendarName(calendarName);
    trig.setDescription(description);
    trig.setStartTime(startTime);
    trig.setEndTime(endTime);
    if(key == null)
        key = new TriggerKey(Key.createUniqueName(null), null);
    trig.setKey(key); 
    if(jobKey != null)
        trig.setJobKey(jobKey);
    trig.setPriority(priority);
    
    if(!jobDataMap.isEmpty())
        trig.setJobDataMap(jobDataMap);
    
    return (T) trig;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:TriggerBuilder.java


示例2: startJob

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
protected void startJob(ScheduleJobEntity jobEntity) {
    try {
    if(scheduler.checkExists(createJobKey(jobEntity))) {
        return;
    }
    JobDetail jobDetail = JobBuilder
            .newJob(DynamicJob.class)
            .withIdentity(createJobKey(jobEntity))
            .setJobData(createJobDataMap(jobEntity.getParameters()))
            .usingJobData(DynamicJobFactory.JOB_ID_KEY, jobEntity.getId())
            .withDescription(jobEntity.getName() + (jobEntity.getRemark() == null ? "" : jobEntity.getRemark()))
            .build();
    MutableTrigger trigger = scheduleTriggerBuilder.buildTrigger(jobEntity.getQuartzConfig());
    trigger.setKey(createTriggerKey(jobEntity));

        scheduler.scheduleJob(jobDetail, trigger);
    } catch (SchedulerException e) {
        throw new BusinessException("启动定时调度失败", e);
    }
}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:21,代码来源:SimpleScheduleJobService.java


示例3: startSniffing

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
@Override
@Transactional(rollbackFor = { SchedulerException.class, ParseException.class })
public void startSniffing(final long snifferId) throws SchedulerException {
	logger.debug("Starting cron job for sniffer: {}", snifferId);
	final Sniffer sniffer = snifferPersistence.getSniffer(snifferId);
	if (sniffer == null) {
		throw new SchedulerException("Sniffer not found: " + snifferId);
	}
	stopAndDeleteAllSnifferJobs(sniffer.getId());
	MutableTrigger trigger;
	try {
		trigger = CronScheduleBuilder.cronScheduleNonvalidatedExpression(sniffer.getScheduleCronExpression())
				.withMisfireHandlingInstructionDoNothing().build();
	} catch (final ParseException e) {
		throw new SchedulerException("Failed to parse cron expression", e);
	}
	trigger.setKey(getKey(sniffer, sniffer.getLogSourceId()));
	final JobDetail jobDetail = JobBuilder.newJob(SnifferJob.class).requestRecovery()
			.withIdentity(getJobKey(sniffer, sniffer.getLogSourceId())).build();
	scheduler.scheduleJob(jobDetail, trigger);
	final ScheduleInfo scheduleInfo = scheduleInfoAccess.getScheduleInfo(snifferId);
	scheduleInfo.setScheduled(true);
	scheduleInfoAccess.updateScheduleInfo(snifferId, scheduleInfo);
	logger.info("Scheduled cron job for sniffer {} and log source {} with trigger {}", sniffer,
			sniffer.getLogSourceId(), trigger);
}
 
开发者ID:logsniffer,项目名称:logsniffer,代码行数:27,代码来源:SnifferJobManager.java


示例4: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Build the actual Trigger -- NOT intended to be invoked by end users,
 * but will rather be invoked by a TriggerBuilder which this 
 * ScheduleBuilder is given to.
 * 
 * @see TriggerBuilder#withSchedule(ScheduleBuilder)
 */
@Override
public MutableTrigger build() {

    SimpleTriggerImpl st = new SimpleTriggerImpl();
    st.setRepeatInterval(interval);
    st.setRepeatCount(repeatCount);
    st.setMisfireInstruction(misfireInstruction);
    
    return st;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:SimpleScheduleBuilder.java


示例5: buildTriggersByFQJobNameMap

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
private Map<JobKey, List<MutableTrigger>> buildTriggersByFQJobNameMap(List<MutableTrigger> triggers) {
    
    Map<JobKey, List<MutableTrigger>> triggersByFQJobName = new HashMap<JobKey, List<MutableTrigger>>();
    
    for(MutableTrigger trigger: triggers) {
        List<MutableTrigger> triggersOfJob = triggersByFQJobName.get(trigger.getJobKey());
        if(triggersOfJob == null) {
            triggersOfJob = new LinkedList<MutableTrigger>();
            triggersByFQJobName.put(trigger.getJobKey(), triggersOfJob);
        }
        triggersOfJob.add(trigger);
    }

    return triggersByFQJobName;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:XMLSchedulingDataProcessor.java


示例6: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Build the actual Trigger -- NOT intended to be invoked by end users, but
 * will rather be invoked by a TriggerBuilder which this ScheduleBuilder is
 * given to.
 * 
 * @see TriggerBuilder#withSchedule(ScheduleBuilder)
 */
@Override
public MutableTrigger build() {

    CronTriggerImpl ct = new CronTriggerImpl();

    ct.setCronExpression(cronExpression);
    ct.setTimeZone(cronExpression.getTimeZone());
    ct.setMisfireInstruction(misfireInstruction);

    return ct;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:CronScheduleBuilder.java


示例7: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Build the actual Trigger -- NOT intended to be invoked by end users,
 * but will rather be invoked by a TriggerBuilder which this 
 * ScheduleBuilder is given to.
 * 
 * @see TriggerBuilder#withSchedule(ScheduleBuilder)
 */
@Override
public MutableTrigger build() {

    DailyTimeIntervalTriggerImpl st = new DailyTimeIntervalTriggerImpl();
    st.setRepeatInterval(interval);
    st.setRepeatIntervalUnit(intervalUnit);
    st.setMisfireInstruction(misfireInstruction);
    st.setRepeatCount(repeatCount);
    
    if(daysOfWeek != null)
        st.setDaysOfWeek(daysOfWeek);
    else
        st.setDaysOfWeek(ALL_DAYS_OF_THE_WEEK);

    if(startTimeOfDay != null)
        st.setStartTimeOfDay(startTimeOfDay);
    else
        st.setStartTimeOfDay(TimeOfDay.hourAndMinuteOfDay(0, 0));

    if(endTimeOfDay != null)
        st.setEndTimeOfDay(endTimeOfDay);
    else
        st.setEndTimeOfDay(TimeOfDay.hourMinuteAndSecondOfDay(23, 59, 59));
    
    return st;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:DailyTimeIntervalScheduleBuilder.java


示例8: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Build the actual Trigger -- NOT intended to be invoked by end users,
 * but will rather be invoked by a TriggerBuilder which this 
 * ScheduleBuilder is given to.
 * 
 * @see TriggerBuilder#withSchedule(ScheduleBuilder)
 */
@Override
public MutableTrigger build() {

    CalendarIntervalTriggerImpl st = new CalendarIntervalTriggerImpl();
    st.setRepeatInterval(interval);
    st.setRepeatIntervalUnit(intervalUnit);
    st.setMisfireInstruction(misfireInstruction);
    st.setTimeZone(timeZone);
    st.setPreserveHourOfDayAcrossDaylightSavings(preserveHourOfDayAcrossDaylightSavings);
    st.setSkipDayIfHourDoesNotExist(skipDayIfHourDoesNotExist);

    return st;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:CalendarIntervalScheduleBuilder.java


示例9: buildTrigger

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
@Override
public MutableTrigger buildTrigger(String config) {
    JSONObject configObj = JSON.parseObject(config);
    switch (configObj.getString("type")) {
        case "cron":
            String cron = configObj.getString("config");
            return CronScheduleBuilder.cronSchedule(cron)
                    .build();
        default:
            throw new UnsupportedOperationException(config);
    }

}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:14,代码来源:SmartScheduleTriggerBuilder.java


示例10: getScheduleBuilder

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
@Override
@JsonIgnore
public ScheduleBuilder getScheduleBuilder() {
    return new ScheduleBuilder<SimpleTrigger>() {
        @Override
        protected MutableTrigger build() {
            return SimpleScheduleBuilder.simpleSchedule()
                    .withRepeatCount(repeatCount)
                    .withIntervalInMilliseconds(repeatInterval)
                    .withMisfireHandlingInstructionNextWithRemainingCount()
                    .build();
        }
    };
}
 
开发者ID:Netflix,项目名称:Fenzo,代码行数:15,代码来源:IntervalTrigger.java


示例11: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Build the actual Trigger -- NOT intended to be invoked by end users,
 * but will rather be invoked by a TriggerBuilder which this
 * ScheduleBuilder is given to.
 */
@Override
public MutableTrigger build() {

    PeriodIntervalTriggerImpl pt = new PeriodIntervalTriggerImpl();
    pt.setRepeatPeriod(repeatPeriod);
    pt.setMisfireInstruction(misfireInstruction);

    return pt;
}
 
开发者ID:motech,项目名称:motech,代码行数:15,代码来源:PeriodIntervalScheduleBuilder.java


示例12: addTriggerToSchedule

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
protected void addTriggerToSchedule(MutableTrigger trigger) {
    loadedTriggers.add(trigger);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:XMLSchedulingDataProcessor.java


示例13: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
@Override
protected MutableTrigger build() {
    OnDemandTrigger onDemandTrigger = new OnDemandTrigger();
    onDemandTrigger.setMisfireInstruction(MISFIRE_INSTRUCTION_FIRE_NOW);
    return onDemandTrigger;
}
 
开发者ID:taboola,项目名称:taboola-cronyx,代码行数:7,代码来源:OnDemandScheduleBuilder.java


示例14: getLoadedTriggers

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
/**
 * Returns a <code>List</code> of triggers loaded from the xml file.
 * <p/>
 * 
 * @return a <code>List</code> of triggers.
 */
protected List<MutableTrigger> getLoadedTriggers() {
    return Collections.unmodifiableList(loadedTriggers);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:XMLSchedulingDataProcessor.java


示例15: build

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
protected abstract MutableTrigger build(); 
开发者ID:lamsfoundation,项目名称:lams,代码行数:2,代码来源:ScheduleBuilder.java


示例16: buildTrigger

import org.quartz.spi.MutableTrigger; //导入依赖的package包/类
MutableTrigger buildTrigger(String config); 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:2,代码来源:ScheduleTriggerBuilder.java



注:本文中的org.quartz.spi.MutableTrigger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HLL类代码示例发布时间:2022-05-22
下一篇:
Java PollingIncrementalLister类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap