org.quartz.Trigger.clearAllTriggerListeners()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中org.quartz.Trigger.clearAllTriggerListeners()方法的一些代码示例,展示了Trigger.clearAllTriggerListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.clearAllTriggerListeners()方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:clearAllTriggerListeners

Trigger.clearAllTriggerListeners介绍

[英]Remove all TriggerListeners from the Trigger.
[中]从Trigger中删除所有TriggerListeners。

代码示例

代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz

protected Trigger retrieveTrigger(Connection conn, String triggerName, String groupName)
  throws JobPersistenceException {
  try {
    Trigger trigger = getDelegate().selectTrigger(conn, triggerName,
        groupName);
    if (trigger == null) {
      return null;
    }
    
    // In case Trigger was BLOB, clear out any listeners that might 
    // have been serialized.
    trigger.clearAllTriggerListeners();
    
    String[] listeners = getDelegate().selectTriggerListeners(conn,
        triggerName, groupName);
    for (int i = 0; i < listeners.length; ++i) {
      trigger.addTriggerListener(listeners[i]);
    }
    return trigger;
  } catch (Exception e) {
    throw new JobPersistenceException("Couldn't retrieve trigger: "
        + e.getMessage(), e);
  }
}

代码示例来源:origin: quartz/quartz-all

protected Trigger retrieveTrigger(Connection conn, String triggerName, String groupName)
  throws JobPersistenceException {
  try {
    Trigger trigger = getDelegate().selectTrigger(conn, triggerName,
        groupName);
    if (trigger == null) {
      return null;
    }
    
    // In case Trigger was BLOB, clear out any listeners that might 
    // have been serialized.
    trigger.clearAllTriggerListeners();
    
    String[] listeners = getDelegate().selectTriggerListeners(conn,
        triggerName, groupName);
    for (int i = 0; i < listeners.length; ++i) {
      trigger.addTriggerListener(listeners[i]);
    }
    return trigger;
  } catch (Exception e) {
    throw new JobPersistenceException("Couldn't retrieve trigger: "
        + e.getMessage(), e);
  }
}

相关文章