当前位置: 首页>>代码示例>>Java>>正文


Java OperableTrigger.getCalendarName方法代码示例

本文整理汇总了Java中org.quartz.spi.OperableTrigger.getCalendarName方法的典型用法代码示例。如果您正苦于以下问题:Java OperableTrigger.getCalendarName方法的具体用法?Java OperableTrigger.getCalendarName怎么用?Java OperableTrigger.getCalendarName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.quartz.spi.OperableTrigger的用法示例。


在下文中一共展示了OperableTrigger.getCalendarName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeCalendar

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
/**
 * <p>
 * Remove (delete) the <code>{@link org.quartz.Calendar}</code> with the
 * given name.
 * </p>
 *
 * <p>
 * If removal of the <code>Calendar</code> would result in
 * <code>Trigger</code>s pointing to non-existent calendars, then a
 * <code>JobPersistenceException</code> will be thrown.</p>
 *       *
 * @param calName The name of the <code>Calendar</code> to be removed.
 * @return <code>true</code> if a <code>Calendar</code> with the given name
 * was found and removed from the store.
 */
public boolean removeCalendar(String calName)
    throws JobPersistenceException {
    int numRefs = 0;

    synchronized (lock) {
        for (TriggerWrapper trigger : triggers) {
            OperableTrigger trigg = trigger.trigger;
            if (trigg.getCalendarName() != null
                    && trigg.getCalendarName().equals(calName)) {
                numRefs++;
            }
        }
    }

    if (numRefs > 0) {
        throw new JobPersistenceException(
                "Calender cannot be removed if it referenced by a Trigger!");
    }

    return (calendarsByName.remove(calName) != null);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:RAMJobStore.java

示例2: doUpdateOfMisfiredTrigger

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
private void doUpdateOfMisfiredTrigger(Connection conn, OperableTrigger trig, boolean forceState, String newStateIfNotComplete, boolean recovering) throws JobPersistenceException {
    Calendar cal = null;
    if (trig.getCalendarName() != null) {
        cal = retrieveCalendar(conn, trig.getCalendarName());
    }

    schedSignaler.notifyTriggerListenersMisfired(trig);

    trig.updateAfterMisfire(cal);

    if (trig.getNextFireTime() == null) {
        storeTrigger(conn, trig,
            null, true, STATE_COMPLETE, forceState, recovering);
        schedSignaler.notifySchedulerListenersFinalized(trig);
    } else {
        storeTrigger(conn, trig, null, true, newStateIfNotComplete,
                forceState, false);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:JobStoreSupport.java


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